matches one of our IP addresses, and if so, we set a fact to true.
I'm sure there's a better way to do this.
Signed-off-by: Stephen Gran <steve@lobefin.net>
--- /dev/null
+["bugs","qa"].each do |service|
+ Facter.add(service + "_host") do
+ service_name = "#{service}." + Facter.domain
+ active = false
+
+ setcode do
+ if FileTest.exist?("/usr/bin/dig")
+ %x{/usr/bin/dig +short -t a #{service_name}}.chomp.each do |service_ip|
+ Facter.interfaces.split(',').each do |my_interface|
+ my_ip = Facter.value("ipaddress_" + my_interface)
+ if my_ip == service_ip
+ active = "true"
+ end
+ end
+ end
+ end
+ active
+ end
+ end
+end
"mtr-tiny": ensure => latest;
"nload": ensure => latest;
"pciutils": ensure => latest;
+ "dnsutils:": ensure => latest;
"bash-completion": ensure => latest;
"dsa-nagios-nrpe-config": ensure => latest;
}