[colug-432] Puppet and templates

ME me at nerdyshawn.com
Thu Dec 18 00:53:03 EST 2014


I use puppet 2.7 open source version, and typically I have my templates
folder at the same level as the manifests directory within the modules I
write. One thing at first glance your directory tree is listed as
"templates" yet your syntax you are calling "template". Let me know how
that works for you and if you're still have issues in the morning let me
know, I'll check my master for further syntax since its late and I don't
remember. Good luck and have fun!

On Wed, Dec 17, 2014 at 10:30 PM, Mike Plemmons <mikeplemmons at gmail.com>
wrote:
>
> I am trying to understand the use of templates but it appears I have come
> across an error that has me stumped.
>
> [root at puppet ~]# puppet agent -t
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Loading facts
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Could not find template 'issue/issue.erb' at
> /etc/puppetlabs/puppet/modules/issue/manifests/init.pp:15 on node
> puppet.n1mtp.com
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
>
> All the documentation I see states that I am using the correct directory
> structure for the templates and that my use of the template in init.pp is
> correct.  What am I missing?
>
> I am using Puppet Enterprise 3.7 and performing the test on the Puppet
> server itself.
>
> [root at puppet ~]# cd /etc/puppetlabs/puppet/modules
> [root at puppet modules]# tree
> .
> └── issue
>     └── manifests
>         ├── init.pp
>         └── templates
>             └── issue.erb
>
> [root at puppet manifests]# cat init.pp
> class issue {
>     notify { 'Setting up /etc/issue': }
>
>     package { 'issue':
>         ensure => installed,
>     }
>
>     file { '/etc/issue':
>         path    => '/etc/issue',
>         ensure  => file,
>         owner   => 'root',
>         group   => 'root',
>         mode    => '0644',
>         require => Package['issue'],
>         content => template('issue/issue.erb'),
>     }
>
> }
>
> [root at puppet manifests]# cd templates/
> [root at puppet templates]# cat issue.erb
> Puppet Test Environment
> \S
> Kernel \r on an \m
> HN: <% @hostname %>
> IP: <% @ipaddress %>
>
>
>
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20141218/00e1e7ce/attachment.html 


More information about the colug-432 mailing list