Hi,
I've seen some blog posts about adding server roles to Puppet.
Some of them with this fact snippet:
if File.exists?("/etc/roles.txt")
File.readlines("/etc/roles.txt").each do |line|
if line =~ /^(.+)=(.+)$/
fact = $1
value = $2
Facter.add(fact) do
# confine :kernel => "Linux"
setcode {value}
end
end
end
end
Since I have both linux and windows boxes backed with Puppet, it is correct to add the "confine :kernel => "Linux"" next to "Facter.add(fact) and replicate the whole block changing this "confine :kernel to "Windows" and the path (to match window paths c:\foo)?
Is this the right approach?
thanks in advance.
Cheers,