1 ["bugs","qa"].each do |service|
2 Facter.add(service + "_host") do
3 service_name = "#{service}." + Facter.domain
7 if FileTest.exist?("/usr/bin/dig")
8 %x{/usr/bin/dig +short -t a #{service_name}}.chomp.each do |service_ip|
9 Facter.interfaces.split(',').each do |my_interface|
10 my_ip = Facter.value("ipaddress_" + my_interface)
11 if my_ip == service_ip