Ed Greenberg
2010-May-05 21:07 UTC
[Puppet Users] List of available variables for use in templates
When writing an ERB template, I know that I can define variables in my nodes and classes, and that the facter variables for the node are available. I''d like to know if there are any other predefined puppet variables available. In specific, I''d like the node''s name in the node definition. node "foobar" { include this include that } I''d like to get "foobar". In my case, this is probably NOT the facter variable fqdn or hostname. I can''t find this documented anywhere. Assistance? Thanks, </edg> Ed Greenberg -- 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.
Michael DeHaan
2010-May-06 15:26 UTC
Re: [Puppet Users] List of available variables for use in templates
On Wed, May 5, 2010 at 5:07 PM, Ed Greenberg <edg@greenberg.org> wrote:> When writing an ERB template, I know that I can define variables in my nodes > and classes, and that the facter variables for the node are available. > > I''d like to know if there are any other predefined puppet variables > available. In specific, I''d like the node''s name in the node definition. > > node "foobar" { > include this > include that > } > > I''d like to get "foobar". In my case, this is probably NOT the facter > variable fqdn or hostname. > > I can''t find this documented anywhere.Any particular reason you''re not using the node name as the hostname? Nodes can either use the shortname or the fqdn. --Michael -- 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.
Ed Greenberg
2010-May-06 18:04 UTC
Re: [Puppet Users] List of available variables for use in templates
On 05/06/2010 10:26 AM, Michael DeHaan wrote:> On Wed, May 5, 2010 at 5:07 PM, Ed Greenberg<edg@greenberg.org> wrote: > >> When writing an ERB template, I know that I can define variables in my nodes >> and classes, and that the facter variables for the node are available. >> >> I''d like to know if there are any other predefined puppet variables >> available. In specific, I''d like the node''s name in the node definition. >> >> node "foobar" { >> include this >> include that >> } >> >> I''d like to get "foobar". In my case, this is probably NOT the facter >> variable fqdn or hostname. >> >> I can''t find this documented anywhere. >> > Any particular reason you''re not using the node name as the hostname? > > Nodes can either use the shortname or the fqdn. > > --Michael > >These are managed hosting customers. The customer can change hostname at will. We something that won''t change, so we can find the server no matter what. If I can''t find a way to do this, I can visit each host in the puppet config and stick the node name into a variable, but I was hoping not to have to do/maintain that. Question remains open. Does anybody know? </edg> -- 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.