Richard Crowley
2011-Mar-01 22:11 UTC
[Puppet Users] Agent certificate name in a manifest on the master
Each of my EC2 instances run Puppet as `puppet agent ... --certname=$(cat /etc/puppet/certname)`, which works very well to get each instance to the correct node stanza in nodes.pp. I would like to use this certname value in the default node stanza thus: node default { @@nagios_host { "$settings::certname": } } Unsurprisingly, $settings::certname is the master''s certname. $certname is empty. Is there a way to access the agent''s certname as a variable? Thanks, Richard -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Richard Crowley
2011-Mar-01 22:31 UTC
[Puppet Users] Re: Agent certificate name in a manifest on the master
> Is there a way to access the agent''s certname as a variable? >Volcane suggested on IRC: FACTER_certname=$(cat /etc/puppet/certname) puppet agent ... --certname=$(cat /etc/puppet/certname) which works fine. I turned it into a Ruby fact: require ''facter'' require ''puppet'' Facter.add :certname do setcode do Puppet[:certname] end end Thanks for the help, R.I. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ben Hughes
2011-Mar-01 22:33 UTC
Re: [Puppet Users] Agent certificate name in a manifest on the master
On Tue, Mar 01, 2011 at 02:11:31PM -0800, Richard Crowley wrote:> Is there a way to access the agent''s certname as a variable?Other than the ones listed at http://docs.puppetlabs.com/guides/faq.html#are-there-variables-available-other-than-those-provided-by-facter not really. Could you expose the contents of /etc/certname via a simple Fact? -- Ben Hughes || http://www.puppetlabs.com/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.