I encountered the same problem while trying to deploy custom facts. The 
solution that I have used is the assign a definite *certname* in 
puppet.conf under both the [agent] and [master] sections of the file, 
giving it the certname puppetmaster. After this, you need to deactivate the 
node as it was previously named (probably its fqdn), accept any SSL 
certificates it requested, then restart the puppet agent service. That 
allowed the backend (PuppetDB) to sync the puppetmaster's facts when the 
agent was re-run for me.

Good luck

On Tuesday, April 15, 2014 10:09:46 AM UTC-4, Bob Hoekstra wrote:
>
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/012c9100-3aab-4a10-b99b-9abd3ed9c3f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to