Is it possible to use configuration variables in templates? For example, I want a template to reference ssldir from /etc/puppet/ puppet.conf. I tried "<%= ssldir %>", but that did not work. -- 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.
Christopher Johnston
2010-Jan-12 17:28 UTC
Re: [Puppet Users] Config variables in templates
I believe the variables are pulled in from your puppet configs and/or facts only. I don''t believe the values in puppet.conf are used. Correct me if I am wrong though. -Chris On Tue, Jan 12, 2010 at 12:24 PM, JL <jlyman2@gmail.com> wrote:> Is it possible to use configuration variables in templates? For > example, I want a template to reference ssldir from /etc/puppet/ > puppet.conf. I tried "<%= ssldir %>", but that did not work. > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > >-- 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.
<%= Puppet[:ssldir] %> On Tue, Jan 12, 2010 at 12:24 PM, JL <jlyman2@gmail.com> wrote:> Is it possible to use configuration variables in templates? For > example, I want a template to reference ssldir from /etc/puppet/ > puppet.conf. I tried "<%= ssldir %>", but that did not work. > > -- > 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. > > > >-- Trevor Vaughan Vice President, Onyx Point, Inc (410) 541-6699 tvaughan@onyxpoint.com -- This account not approved for unencrypted proprietary information -- -- 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.
I was hoping there was a way to do it with ruby, but I am just learning the language. I know that "puppetd --genconfig" returns the value, so I was thinking there must be a way to do it with a simple ruby code snippet embedded within the template. -- 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.
Never mind, that''s what I was looking for Trevor, thanks. On Jan 12, 12:56 pm, JL <jlym...@gmail.com> wrote:> I was hoping there was a way to do it with ruby, but I am just > learning the language. I know that "puppetd --genconfig" returns the > value, so I was thinking there must be a way to do it with a simple > ruby code snippet embedded within the template.-- 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.
How about qualified variables? For example: myclass.pp: class myclass { $test = "content" } otherclass/template.erb: <%= myclass::test %> On Jan 12, 12:45 pm, Trevor Vaughan <tvaug...@onyxpoint.com> wrote:> <%= Puppet[:ssldir] %>-- 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.
Christopher Johnston
2010-Jan-12 18:20 UTC
Re: [Puppet Users] Re: Config variables in templates
Ok cool! That will come in handy. Sent from my iPhone On Jan 12, 2010, at 12:56 PM, JL <jlyman2@gmail.com> wrote:> Never mind, that''s what I was looking for Trevor, thanks. > > On Jan 12, 12:56 pm, JL <jlym...@gmail.com> wrote: >> I was hoping there was a way to do it with ruby, but I am just >> learning the language. I know that "puppetd --genconfig" returns the >> value, so I was thinking there must be a way to do it with a simple >> ruby code snippet embedded within the template. > -- > 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 > . > >-- 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.