I''m following the example provided in the type reference under ''zone'', i.e.: zone{myzone: autoboot=>true, create_args=>"-b", ip=>"nge0:10:130.55.201", path=>"/zoneds/%s", realhostname=>"myzone.example.com", sysidcfg=>template(sysidcfg) } with the following template: system_locale=en_AU timezone=Australia/NSW terminal=xterms security_policy=NONE root_password=elided timeserver=localhost name_service=DNS {domain_name=<%= domain %> name_server=10.132.2.150} network_interface=primary {hostname=<%= realhostname %> ip_address=<%= ip %> netmask=<%= netmask %> protocol_ipv6=no default_route=<%= defaultroute %>} nfs4_domain=dynamic The sysidcfg template is ripped straight from <http://reductivelabs.com/trac/puppet/wiki/TypeReference#zone> but it doesn''t work: err: Could not retrieve catalog: Failed to parse template sysidcfg: Could not find value for ''realhostname'' at /staging/puppet/production/manifests/nodes.pp:90 on node elided.example.com This is with Puppet 0.24.7 on both client and server. I''ve not really needed the templating before so it''s possible that there''s a really obvious error in the template provided in the type reference and I''m just not seeing it. Matt -- * Matt McLeod | mail: matt@boggle.org | blog: http://abortrephrase.com/ * --- People can do the work, so machines have time to think --- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Matt! On Wed, Jan 28, 2009 at 11:22 AM, Matt McLeod <matt@boggle.org> wrote:> network_interface=primary {hostname=<%= realhostname %> > > err: Could not retrieve catalog: Failed to parse template sysidcfg: Could not find value for ''realhostname'' at /staging/puppet/production/manifests/nodes.pp:90 on node elided.example.com >I''d guess that it''s looking for a ''realhostname'' fact. Facter 1.5.2 on opensolaris here doesn''t output a fact with that name. Does it work if you substitute ''hostname'' or ''fqdn''? cheers rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Matt, There is no realhostname variable in scope when the template is getting called. Variables in templates either need to be facts or set in the scope of Puppet they are being called from. Does that make sense? Andrew On Tue, Jan 27, 2009 at 5:22 PM, Matt McLeod <matt@boggle.org> wrote:> > I''m following the example provided in the type reference > under ''zone'', i.e.: > > zone{myzone: > autoboot=>true, > create_args=>"-b", > ip=>"nge0:10:130.55.201", > path=>"/zoneds/%s", > realhostname=>"myzone.example.com", > sysidcfg=>template(sysidcfg) > } > > with the following template: > > system_locale=en_AU > timezone=Australia/NSW > terminal=xterms > security_policy=NONE > root_password=elided > timeserver=localhost > name_service=DNS {domain_name=<%= domain %> > name_server=10.132.2.150} > network_interface=primary {hostname=<%= realhostname %> > ip_address=<%= ip %> > netmask=<%= netmask %> > protocol_ipv6=no > default_route=<%= defaultroute %>} > nfs4_domain=dynamic > > The sysidcfg template is ripped straight from > <http://reductivelabs.com/trac/puppet/wiki/TypeReference#zone> > but it doesn''t work: > > err: Could not retrieve catalog: Failed to parse template sysidcfg: Could > not find value for ''realhostname'' at > /staging/puppet/production/manifests/nodes.pp:90 on node > elided.example.com > > This is with Puppet 0.24.7 on both client and server. > > I''ve not really needed the templating before so it''s possible that > there''s a really obvious error in the template provided in the > type reference and I''m just not seeing it. > > Matt > > -- > * Matt McLeod | mail: matt@boggle.org | blog: http://abortrephrase.com/ * > --- People can do the work, so machines have time to think --- > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
OK. So the docco is completely wrong: everything referenced in the template needs to be set as a variable prior to defining the zone. I''d assumed from context that the template was going to have the previously-declared object properties passed to it. I can live with that, I was going to abstract the zone type anyway. Matt Andrew Shafer wrote:> Matt, > > There is no realhostname variable in scope when the template is getting > called. > > Variables in templates either need to be facts or set in the scope of Puppet > they are being called from. > > Does that make sense? > > Andrew > > > On Tue, Jan 27, 2009 at 5:22 PM, Matt McLeod <matt@boggle.org> wrote: > > > > > I''m following the example provided in the type reference > > under ''zone'', i.e.: > > > > zone{myzone: > > autoboot=>true, > > create_args=>"-b", > > ip=>"nge0:10:130.55.201", > > path=>"/zoneds/%s", > > realhostname=>"myzone.example.com", > > sysidcfg=>template(sysidcfg) > > } > > > > with the following template: > > > > system_locale=en_AU > > timezone=Australia/NSW > > terminal=xterms > > security_policy=NONE > > root_password=elided > > timeserver=localhost > > name_service=DNS {domain_name=<%= domain %> > > name_server=10.132.2.150} > > network_interface=primary {hostname=<%= realhostname %> > > ip_address=<%= ip %> > > netmask=<%= netmask %> > > protocol_ipv6=no > > default_route=<%= defaultroute %>} > > nfs4_domain=dynamic > > > > The sysidcfg template is ripped straight from > > <http://reductivelabs.com/trac/puppet/wiki/TypeReference#zone> > > but it doesn''t work: > > > > err: Could not retrieve catalog: Failed to parse template sysidcfg: Could > > not find value for ''realhostname'' at > > /staging/puppet/production/manifests/nodes.pp:90 on node > > elided.example.com > > > > This is with Puppet 0.24.7 on both client and server. > > > > I''ve not really needed the templating before so it''s possible that > > there''s a really obvious error in the template provided in the > > type reference and I''m just not seeing it. > > > > Matt > > > > -- > > * Matt McLeod | mail: matt@boggle.org | blog: http://abortrephrase.com/ * > > --- People can do the work, so machines have time to think --- > > > > > > > > > >-- * Matt McLeod | mail: matt@boggle.org | blog: http://abortrephrase.com/ * --- People can do the work, so machines have time to think --- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt McLeod wrote:> OK. So the docco is completely wrong: everything referenced in the > template needs to be set as a variable prior to defining the zone. > I''d assumed from context that the template was going to have the > previously-declared object properties passed to it. >Sorry - how is the documentation wrong? You can''t define a variable in a template without declaring the variable. If you don''t reference said variable in a template then where is the value going to come from? Can you point me to the documentation that confused you? Thanks James Turnbull - -- Author of: * Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) * Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) * Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmBP28ACgkQ9hTGvAxC30DnPwCcCoQiOTvycok2/0BwBaE7sQJ8 D0UAn3zAPhXUHf5wF4idsykWdyGa8pMJ =WOTs -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
James Turnbull wrote:> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Matt McLeod wrote: > > OK. So the docco is completely wrong: everything referenced in the > > template needs to be set as a variable prior to defining the zone. > > I''d assumed from context that the template was going to have the > > previously-declared object properties passed to it. > > > Sorry - how is the documentation wrong? You can''t define a variable > in a template without declaring the variable. If you don''t reference > said variable in a template then where is the value going to come from? > > Can you point me to the documentation that confused you?As per my original message: http://reductivelabs.com/trac/puppet/wiki/TypeReference#zone The example provided doesn''t work because it doesn''t define any of the variables used in the template. As this was my first exposure to the template system (we haven''t had any need for it thusfar, most of our configs are site-wide) it wasn''t obvious that the template wasn''t going to pick that stuff up from the zone type definition it was being called from where "realhostname" *is* being defined, just not as a variable. -- * Matt McLeod | mail: matt@boggle.org | blog: http://abortrephrase.com/ * --- People can do the work, so machines have time to think --- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---