puppet master --compile <server> giving "Warning: Unknown variable: " for Facts

1,184 views
Skip to first unread message

HPUX_PUPPET

unread,
Dec 1, 2016, 11:09:02 AM12/1/16
to Puppet Users
I am running into an odd issue in Puppet 4.8.0 running under Foreman 1.13.2

When, on the master, I run puppet master --verbose --compile myserver.domain.com I get an error on basic facts with "Unknown Variable". I have had this happen on multiple classes.  

puppet master --verbose --compile myserver.domain.com
Info: Caching node for myserver.domain.com
Warning: Unknown variable: '::osfamily'. at /etc/puppetlabs/code/environments/development/modules/pam/manifests/init.pp:85:8
Warning: Unknown variable: '::osfamily'. at /etc/puppetlabs/code/environments/development/modules/pam/manifests/init.pp:353:100
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Pam is only supported on RedHat and Suse osfamilies. Your osfamily is identified as <>. at /etc/puppetlabs/code/environments/development/modules/pam/manifests/init.pp:353:7 on node myserver.domain.com
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Pam is only supported on RedHat and Suse osfamilies. Your osfamily is identified as <>. at /etc/puppetlabs/code/environments/development/modules/pam/manifests/init.pp:353:7 on node myserver.domain.com
Error: Failed to compile catalog for node myserver.domain.com: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Pam is only supported on RedHat and Suse osfamilies. Your osfamily is identified as <>. at /etc/puppetlabs/code/environments/development/modules/pam/manifests/init.pp:353:7 on node myserver.domain.com

For reference the pam/manifests/init.pp: 

Line 85:   case $::osfamily {
Line 353: fail("Pam is only supported on RedHat and Suse osfamilies. Your osfamily is identified as <${::osfamily}>.")

The odd part here is that when I run the command with --debug I see that it resolves osfamily from the hosts's facts yaml file:

Debug: Facter: fact "osfamily" has resolved to "RedHat".


Do I need to make some sort of modification or setup change to ensure it picks up the files correctly?  

This box worked fine previously when I was running a version < 4.8.0 as I used it to do a lot of my coding and testing via the puppet master --compile <server name> to verify the code was compiling properly on the master.

Now the other odd thing is that the catalog compiles fine when I run puppet agent --test --verbose on myserver.domain.com. So it seems somehow ties to the puppet master --compile process.

Anyone able to point me where to look check that I don't have a bad config setting or something similar? 

Could this be a bug in Puppet 4.8.0? 

Rob Nelson

unread,
Dec 1, 2016, 4:29:59 PM12/1/16
to puppet...@googlegroups.com
You could try using `$osfamily` (no colons) or $facts['os']['family'] if you do not need to support anything older than 3.5.0. I kind of doubt it's related to the prepended colons, but maybe?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3e06a1b7-0a1d-4bc7-8f6b-af9891210f03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim Perry

unread,
Dec 1, 2016, 6:45:23 PM12/1/16
to puppet...@googlegroups.com

The prepended colons are actually the way Puppet 4 guides say to do it now.  It is just odd and why I tossed it out to the forum.


You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/2x1CdXFDtTE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAC76iT9pjhSY1YJAih4%3DaGsBGGZE2o%3D6ZUE088wK2M0Ew9fKig%40mail.gmail.com.

Rob Nelson

unread,
Dec 1, 2016, 7:52:27 PM12/1/16
to puppet...@googlegroups.com
The style guide is being updated, see https://tickets.puppetlabs.com/browse/DOCUMENT-560 (and the epic https://tickets.puppetlabs.com/browse/DOCUMENT-266). You could at least see if the problem is related to the legacy fact vs the facts hash, or with the osfamily entirely, before opening a bug report.
Reply all
Reply to author
Forward
0 new messages