Populate puppet.conf template with certname

I want to manage my puppet.conf with puppet, how do I pull the value for
certname from foreman to populate the puppet.conf template. I playing with
the foreman.rb lib to do a search for certname with no luck.

thanks

Brian Gupta maintains a repository with some templates that do this exact thing [1].

-Sam

  1. https://github.com/bgupta/foreman-templates/blob/master/bg-puppet.conf
··· ----- Original Message ----- From: "Rodrique Heron" To: foreman-users@googlegroups.com Sent: Monday, January 21, 2013 10:31:54 AM Subject: [foreman-users] populate puppet.conf template with certname

I want to manage my puppet.conf with puppet, how do I pull the value for certname from foreman to populate the puppet.conf template. I playing with the foreman.rb lib to do a search for certname with no luck.

thanks


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To view this discussion on the web visit https://groups.google.com/d/msg/foreman-users/-/L8ad0JqvF5kJ .
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

Will this value work for just puppet outside of foreman, to just pull the
computername for the certname?

··· On Monday, January 21, 2013 7:31:54 AM UTC-8, Rodrique Heron wrote: > > I want to manage my puppet.conf with puppet, how do I pull the value for > certname from foreman to populate the puppet.conf template. I playing with > the foreman.rb lib to do a search for certname with no luck. > > thanks >

Thanks for the response, this only applies to templates within Foreman.

··· On Monday, January 21, 2013 10:40:14 AM UTC-5, Sam Kottler wrote: > > Brian Gupta maintains a repository with some templates that do this exact > thing [1]. > > -Sam > > 1. https://github.com/bgupta/foreman-templates/blob/master/bg-puppet.conf > > ----- Original Message ----- > From: "Rodrique Heron" <swy...@gmail.com > > To: forema...@googlegroups.com > Sent: Monday, January 21, 2013 10:31:54 AM > Subject: [foreman-users] populate puppet.conf template with certname > > I want to manage my puppet.conf with puppet, how do I pull the value for > certname from foreman to populate the puppet.conf template. I playing with > the foreman.rb lib to do a search for certname with no luck. > > > thanks > > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/foreman-users/-/L8ad0JqvF5kJ . > To post to this group, send email to forema...@googlegroups.com. > > To unsubscribe from this group, send email to > foreman-user...@googlegroups.com . > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en. >

Sorry I misunderstood your question. I think you just asked this on IRC,
but I didn't respond quickly enough before you quit.

Anyhow, assuming the value of certname is set properly in puppet.conf, you
can access it like this in a template:

<%= Puppet.settings[:certname] %>

Hope that helps!

-Sam

··· On Mon, Jan 21, 2013 at 11:13 AM, Rodrique Heron wrote:

Thanks for the response, this only applies to templates within Foreman.

On Monday, January 21, 2013 10:40:14 AM UTC-5, Sam Kottler wrote:

Brian Gupta maintains a repository with some templates that do this exact
thing [1].

-Sam

  1. https://github.com/bgupta/foreman-templates/blob/master/
    bg-puppet.confhttps://github.com/bgupta/foreman-templates/blob/master/bg-puppet.conf

----- Original Message -----
From: “Rodrique Heron” swy...@gmail.com
To: forema...@googlegroups.com
Sent: Monday, January 21, 2013 10:31:54 AM
Subject: [foreman-users] populate puppet.conf template with certname

I want to manage my puppet.conf with puppet, how do I pull the value for
certname from foreman to populate the puppet.conf template. I playing with
the foreman.rb lib to do a search for certname with no luck.

thanks


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit https://groups.google.com/d/**
msg/foreman-users/-/L8ad0JqvF5kJhttps://groups.google.com/d/msg/foreman-users/-/L8ad0JqvF5kJ.
To post to this group, send email to forema...@googlegroups.com
.
To unsubscribe from this group, send email to foreman-user…@**
googlegroups.com.
For more options, visit this group at http://groups.google.com/**
group/foreman-users?hl=enhttp://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/foreman-users/-/GthJFA4EqngJ.

To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

My puppet.conf erb file, uses:

certname = <%= scope.lookupvar('::clientcert') %>

which I believe is the generic puppet form of including the certname
fact in a template.

Thanks,
Brian

··· On Tue, Sep 24, 2013 at 12:46 PM, Rudy McComb wrote: > Will this value work for just puppet outside of foreman, to just pull the > computername for the certname? > > > On Monday, January 21, 2013 7:31:54 AM UTC-8, Rodrique Heron wrote: >> >> I want to manage my puppet.conf with puppet, how do I pull the value for >> certname from foreman to populate the puppet.conf template. I playing with >> the foreman.rb lib to do a search for certname with no luck. >> >> thanks > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-users+unsubscribe@googlegroups.com. > > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/groups/opt_out.