Is there anywhere that lists the available built-in variables aside from facter and http://docs.puppetlabs.com/guides/faq.html#are-there-variables-available-other-than-those-provided-by-facter ? I''m referring to variables like $title and $name, which are mentioned by http://docs.puppetlabs.com/guides/language_guide.html#defined-resource-types, but are there any others? -- 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.
On Thu, Jun 23, 2011 at 7:46 AM, Patrick <patrick.hemmer@gmail.com> wrote:> Is there anywhere that lists the available built-in variables aside > from facter and http://docs.puppetlabs.com/guides/faq.html#are-there-variables-available-other-than-those-provided-by-facter > ?Pretty sure that''s it. You can dump all variables in scope via: notice(inline_template("<%= scope.to_hash %>")) This isn''t perfect, but should give you the subset: (since facter value such as uptime changes, and in agent/master mode this is totally wrong unless it''s on the same system) notice(inline_template("<%= (scope.to_hash.to_a - Facter.to_hash.to_a).to_yaml %>") This obviously will be different if the notice is in a module, a class, a define, $caller_module, $module_name would only be present if the notice is in the appropriate location.> I''m referring to variables like $title and $name, which are mentioned > by http://docs.puppetlabs.com/guides/language_guide.html#defined-resource-types, > but are there any others? >Anyhow this is what I got back using puppet apply (trimming some extras): - - clientversion - 2.6.4 (Puppet Enterprise 1.0) - - clientcert - pe-master.localdomain - - title - main - - name - main - - environment - production Thanks, Nan -- 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.
This is very useful! Thanks for sharing! On Friday, June 24, 2011 3:03:34 AM UTC-4, Nan Liu wrote:> > On Thu, Jun 23, 2011 at 7:46 AM, Patrick <patrick...@gmail.com<javascript:>> > wrote: > > Is there anywhere that lists the available built-in variables aside > > from facter and > http://docs.puppetlabs.com/guides/faq.html#are-there-variables-available-other-than-those-provided-by-facter > > ? > > Pretty sure that''s it. You can dump all variables in scope via: > notice(inline_template("<%= scope.to_hash %>")) > > This isn''t perfect, but should give you the subset: (since facter > value such as uptime changes, and in agent/master mode this is totally > wrong unless it''s on the same system) > notice(inline_template("<%= (scope.to_hash.to_a - > Facter.to_hash.to_a).to_yaml %>") > > This obviously will be different if the notice is in a module, a > class, a define, $caller_module, $module_name would only be present if > the notice is in the appropriate location. > > > I''m referring to variables like $title and $name, which are mentioned > > by > http://docs.puppetlabs.com/guides/language_guide.html#defined-resource-types > , > > but are there any others? > > > > Anyhow this is what I got back using puppet apply (trimming some extras): > > - - clientversion > - 2.6.4 (Puppet Enterprise 1.0) > - - clientcert > - pe-master.localdomain > - - title > - main > - - name > - main > - - environment > - production > > Thanks, > > Nan > >-- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.