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