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:
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.