--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9e5f1c49-cf71-4eab-a11b-18a9d31b5b0a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks, i think i got something here:
Facter.add("ip_prodlan") do
confine :kernel => "Linux"
setcode do
Facter::Util::Resolution.exec("/sbin/ifconfig | /bin/grep '20.20.\\|30.31.\\|200.30.80.\\|120.' | /bin/awk '{ print $2 }' | /bin/cut -d':' -f2 | /usr/bin/head -n1")
end
end
I'm currently using the custom fact to print the production LAN ip address in /etc/motd .
It usually returns the correct value. But in some cases the "puppet agent -t" command changes the file in a different way than "service puppet restart" does. Any idea?
Another question:
I want my custom fact to do something like this:
if the "Resolution.exec" returns 0 (nothing) then ip_prodlan should use the value of the fact "$ipaddress".
Is it possible to do something like this?
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b3166eb0-3fc2-4688-ac78-ad5ff5dd6c4e%40googlegroups.com.