19th September 2015
Custom Facts in Puppet

================== CUSTOM FACT ================= puppet@testserver:/opt/puppetserver/conf/environments/test/modules/helloworld/lib/facter> cat dhcp_dnsdomain.rb Facter.add(“dhcp_dnsdomain”) do confine :operatingsystem => ‘SLES’ setcode do Facter::Core::Execution.exec(‘/usr/sbin/dhcpcd-test eth0 | grep DNSDOMAIN | cut -d$”\'” -f 2 | rev | cut -d”.” -f 1,2 | rev’) end end ==================== PUPPET MANIFEST ============ puppet@testserver:/opt/puppetserver/conf/environments/test/modules> cat helloworld/manifests/init.pp class helloworld { notify {