I've created a custom fact to detect whether my server is a physical box or
a VMware guest, and have the following class:
class server_management {
notice("hw_type=$hw_type")
case $hw_type {
"physical" : { notice("this is a physical system") }
"virtual" : { notice("this is a virtual system") }
default : { warning("the hw_type fact is not present") }
}
}
This class is included in my role_general class, which is included by every
system in my environment. On the test system I have this:
$ facter | grep hw_type
hw_type => virtual
However, when I run puppetd, I never see any notices or warnings. Am I
missing the purpose of these functions? They work fine if they're used
outside of a class, but I can't seem to get them to print anything out as
used above.
$ sudo /usr/sbin/puppetd --onetime --verbose --noop --debug | egrep -i
'virtual|physical|hw_type|notice'
info: Loading facts in hw_type
info: Loading facts in hw_type
notice: Finished catalog run in 9.51 seconds
What am I doing wrong?
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.