Re: [Puppet Users] Simple issue with templates.

Nigel Kersten
Mon, 03 May 2010 16:22:14 -0000

On Mon, May 3, 2010 at 9:14 AM, Matthew Macdonald-Wallace <
lists@truthisfreedom.org.uk> wrote:

> Hi all,
>
> My brain is now officially dead!
>
> I have a series of modules that have a tree layout as documented in the
> "best practice" guide.
>
> One of the directories I have is "templates" and in this
directory I
> have placed a template.erb file, however no matter how I refer to the
> path in my init.pp, I cannot get it to include.
>
> I''ve even set "templatedir" to /usr/share/puppet/modules
(the module
> dir) in /etc/puppet/puppet.conf but I keep getting the following error:
>
> debug: Scope(Yumrepository[mcollective]): Retrieving template
> puppet:///yumrepositories/templates/repo.template.rb
> err: Puppet::Module::InvalidName
> at /usr/share/puppet/modules/yumrepositories/manifests/init.pp:22
>
> The relevant file stanza is:
>
> file { "/etc/yum.repos.d/$title.repo":
>                        owner   => root,
>                        group   => root,
>                        mode    => 644,
>                        content =>
> template("puppet:///yumrepositories/templates/repo.template.rb"),
>                }
>
> Do I _really_ have to place the templates in /var/lib/puppet/template/ ?
>

No, assuming you have the template in:

$modulepath/yumrepositories/templates/repo.template.erb

you refer to it as:

content => template(''yumrepositories/repo.template.erb'')




>
> I''m hoping to package a number of these manifests as moduels in
git and
> I really want to be able to deploy direct from git rather than cloning
> and then having to copy the template into place.
>
> Thanks in advance,
>
> Matt
>
>
> --
> 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<puppet-users%2Bunsubscribe@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>


--
nigel

--
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