Bob Hoekstra
2014-Apr-15 14:09 UTC
[Puppet Users] Custom fact working, but not on the puppetmaster
This has me confused - please advise. Using open source puppet on AWS
instances. Info is dumped into user-data at creation of the instances, and
a custom fact reads this so that puppet can configure the instance
depending on the content. So far so good. The fact:
# cat /etc/puppet/modules/useful_utils/lib/facter/ud_purpose.rb
require 'facter/util/ec2'
require 'open-uri'
Facter.add("ud_purpose") do
setcode do
if Facter::Util::EC2.userdata.match(/ud_purpose=(\S+)/)
$1
else
'notfound'
end
end
end
On first puppet run, I see the fact bein installed and after this I can see
the fact with "facter -p ud_purpose" on the command line (including
the
puppetmaster host). All good. Then I can check the logs. I have a line in
site.pp
notify{"PURPOSE: ${::ud_purpose}" : }
that works perfectly on all host except the puppet master. For this host I
see
...: PURPOSE:
...: (/Stage[main]/Main/Node[purpose]/Notify[PURPOSE: ]/message) defined
'message' as 'PURPOSE: '
where I expect to see:
... : PURPOSE: PUPPET-0
as I can see (on the command line):
# facter -p ud_purpose
PUPPET-0
Is there anything I am doing wrong? The puppet.conf file is pretty similar
between master and agents, though the master has a few additional lines to
do with puppetdb and environments.
--
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/da0bf579-e020-4b70-948c-0898e8a01ba4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.