]> git.donarmstrong.com Git - dsa-puppet.git/blob - facts/hosts.rb
add usual file disclaimer
[dsa-puppet.git] / facts / hosts.rb
1 Facter.add("brokenhosts") do
2         brokenhosts = "true"
3         if FileTest.exist?("/etc/hosts")
4                 IO.foreach("/etc/hosts") do |x|
5                         x.split.each do |y|
6                                 if y == Facter.value("fqdn")
7                                         brokenhosts = "false"
8                                         break
9                                 end
10                         end
11                 end
12         end
13         setcode do
14                 brokenhosts == "true"
15         end
16 end
17
18