I have a file with this code in it: notify {''a'': message => "${title}" } The output after running ''puppet apply file.pp'': notice: main notice: /Stage[main]//Notify[a]/message: defined ''message'' as ''main'' notice: Finished catalog run in 0.57 seconds I expected this output: notice: a notice: /Stage[main]//Notify[a]/message: defined ''message'' as ''a'' notice: Finished catalog run in 0.57 seconds Why is $title considered to have the value "main"? -- 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.
A resource declaration doesn''t create a new variable scope, so the $title variable has the value of the scope containing the resource, in this case stage main. On 29 May 2013 08:28, <avery@ootbdev.com> wrote:> I have a file with this code in it: > > notify {''a'': > message => "${title}" > } > > The output after running ''puppet apply file.pp'': > > notice: main > notice: /Stage[main]//Notify[a]/message: defined ''message'' as ''main'' > notice: Finished catalog run in 0.57 seconds > > I expected this output: > > notice: a > notice: /Stage[main]//Notify[a]/message: defined ''message'' as ''a'' > notice: Finished catalog run in 0.57 seconds > > Why is $title considered to have the value "main"? > > -- > 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. > > >-- 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.
avery@ootbdev.com
2013-May-31 03:38 UTC
Re: [Puppet Users] Puppet displays title as ''main''
Thanks! That''s interesting because the documentation consistently refers to the first string following the type of a resource as the "title". Hence, my confusion. I''ll email the puppet folks and ask them just to put a note in the docs to clarify this. On Wednesday, May 29, 2013 5:09:50 PM UTC+8, Erik Dalén wrote:> > A resource declaration doesn''t create a new variable scope, so the $title > variable has the value of the scope containing the resource, in this case > stage main. > On 29 May 2013 08:28, <av...@ootbdev.com <javascript:>> wrote: > >> I have a file with this code in it: >> >> notify {''a'': >> message => "${title}" >> } >> >> The output after running ''puppet apply file.pp'': >> >> notice: main >> notice: /Stage[main]//Notify[a]/message: defined ''message'' as ''main'' >> notice: Finished catalog run in 0.57 seconds >> >> I expected this output: >> >> notice: a >> notice: /Stage[main]//Notify[a]/message: defined ''message'' as ''a'' >> notice: Finished catalog run in 0.57 seconds >> >> Why is $title considered to have the value "main"? >> >> -- >> 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...@googlegroups.com <javascript:>. >> To post to this group, send email to puppet...@googlegroups.com<javascript:> >> . >> Visit this group at http://groups.google.com/group/puppet-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> >-- 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.