Hi Puppet-People
I'm playing around with writing a custom resource type for managing my
Apache configs and I would like to use templates. I happened across
Puppet::Util::ResourceTemplate, which seems to do the tricky stuff but
the bit I'm struggling with is getting the template across from the
puppet server to the puppet client.
I have a module with these files:
config/puppet/modules/eec-mike/manifests/init.pp
config/puppet/modules/eec-mike/templates/mikeapache.erb
config/puppet/modules/eec-mike/lib/puppet/type/mike_apache.rb
My 'mike_apache' type is defined in mike_apache.rb and through the magic
of pluginsync, this file is transported to the client and run at the
appropriate time. When I call Puppet::Util::ResourceTemplate.new(), I
need to pass it the pathname of the template. No matter what I give it,
it dies with a "Template ... does not exist" exception.
It would appear that if I refer to the template from a .pp file I would
do something like:
content => template("eec-mike/mikeapache.erb")
and somehow Puppet would work out that it needed to sync the
mikeapache.erb file from the eec-mike/templates directory on the server.
That seems to be the bit that's missing when I refer to a template from
the Ruby code implementing a custom type.
Am I venturing into uncharted territory or am I missing some obvious way
of getting the module templates directory synced across to the client?
Cheers
Grant
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.