Hi all, I''d like to start using templates and I''m doing some test with one of my already working class (bacula). Following dir structure: module_name/manifests/init.pp /templates/file.erb my template wants to copy a file and change a value for client hostname: init.pp: [...] ''/etc/bacula/bacula-fd.conf.template'': ensure => present, content => template("baculafd.erb"); } [...] cat templates/baculafd.erb [...] FileDaemon { Name = <%= hostname %=> FDport = 9102 # where we listen for the director WorkingDirectory = /var/lib/bacula Pid Directory = /var/run Maximum Concurrent Jobs = 20 } [...] Doc says: "Templates are always evaluated by the parser, not by the client. This means that if you are using puppetmasterd, then the templates only need to be on the server, and you never need to download them to the client." But when I run puppet, client complains : # puppetd --test --server ser01.pic.es err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find template ''baculafd.erb'' at /etc/puppet/manifests/services/workernode/modules/computing_bacula/manifests/init.pp:27 on node X Why is it complaining if dir structure is correct? arnau@lx-arnau ~/puppet/manifests/services/workernode/modules/computing_bacula $ ls files manifests templates arnau@lx-arnau ~/puppet/manifests/services/workernode/modules/computing_bacula $ ls templates/ baculafd.erb TIA, Arnau -- 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 12/09/2010 01:17 PM, Arnau Bria wrote:> Hi all, > > I''d like to start using templates and I''m doing some test with one of > my already working class (bacula). > > Following dir structure: > module_name/manifests/init.pp > /templates/file.erb > > > my template wants to copy a file and change a value for client hostname: > > init.pp: > [...] > ''/etc/bacula/bacula-fd.conf.template'': > ensure => present, > content => template("baculafd.erb"); } > [...] > > > cat templates/baculafd.erb > > [...] > FileDaemon { > Name = <%= hostname %=> > FDport = 9102 # where we listen for the director > WorkingDirectory = /var/lib/bacula > Pid Directory = /var/run > Maximum Concurrent Jobs = 20 > } > [...] > > Doc says: > "Templates are always evaluated by the parser, not by the client. This > means that if you are using puppetmasterd, then the templates only need > to be on the server, and you never need to download them to the client." > > But when I run puppet, client complains : > > # puppetd --test --server ser01.pic.es > err: Could not retrieve catalog from remote server: Error 400 on > SERVER: Could not find template ''baculafd.erb'' > at /etc/puppet/manifests/services/workernode/modules/computing_bacula/manifests/init.pp:27 > on node X > > Why is it complaining if dir structure is correct? > > arnau@lx-arnau ~/puppet/manifests/services/workernode/modules/computing_bacula $ ls > files manifests templates > arnau@lx-arnau ~/puppet/manifests/services/workernode/modules/computing_bacula $ ls templates/ > baculafd.erbHi, according to http://docs.puppetlabs.com/guides/modules.html, you should be using content => template("computing_bacula/baculafd.erb"); including the module name in the template path. HTH, Felix -- 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, Dec 9, 2010 at 23:17, Arnau Bria <arnaubria@pic.es> wrote:> content => template("baculafd.erb"); }content => template(''computing_bacula/baculafd.erb'') You need to prefix the template with the module name, which is what puppet uses to locate it. Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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 all, thanks for your replies. So doc is confusing here: http://projects.puppetlabs.com/projects/1/wiki/Puppet_Templating [...] content => template("tracsite.erb"), [...] Cheers, Arnau -- 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 12/09/2010 03:12 PM, Arnau Bria wrote:> Hi all, > > thanks for your replies. > > So doc is confusing here: > > http://projects.puppetlabs.com/projects/1/wiki/Puppet_Templating > [...] > content => template("tracsite.erb"), > [...]Ah, but that document assumes that your templates are directly inside your $templatesdir, not in a module. That can indeed be confusing. You may want to take a look and see if there is a good place in there to add a warning about this. Cheers, Felix -- 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, 09 Dec 2010 15:28:22 +0100 Felix Frank wrote:> On 12/09/2010 03:12 PM, Arnau Bria wrote: > > Hi all, > > > > thanks for your replies. > > > > So doc is confusing here: > > > > http://projects.puppetlabs.com/projects/1/wiki/Puppet_Templating > > [...] > > content => template("tracsite.erb"), > > [...] > > Ah, but that document assumes that your templates are directly inside > your $templatesdir, not in a module.yep. for that reason I said confusing and not wrong :-)> That can indeed be confusing. You may want to take a look and see if > there is a good place in there to add a warning about this.I''ll create my user and do the edit.> Cheers, > FelixCheers, Arnau -- 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.