I have had a look around and cannot seem to find out whether this is
possible. To explain further (using 2.7.13 btw)...
I have
- a module that I am using to configure various things about the
network, lets call it 'my_network'
- another module that defines my platform, for arguments sake
'my_webserver'
Now, in the 'my_network' module I have a definedtype that generates
/etc/network/interfaces from a given ERB template which is associated with
the platform, simplified version:
define my_network::interfaces ($template = $title) {
file { '/etc/network/interfaces':
ensure => present,
content => template($template),
}
}
I call this like so from 'my_webserver':
my_network::interfaces { my_webserver/interfaces_template.erb: }
This results in an error where it cannot see the template:
*err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Failed to parse template my_webserver/interfaces_template.erb: undefined
method `[]' for nil:NilClass at
/local/puppet/env/production/modules/my_network/manifests/interfaces.pp:47
on node mynode.com*
*
*
I also tried this using Classes rather then definedtypes and had the same
problem.
What I want to do is have the function for handling network configuration
in its own module (to avoid duplication of code and confusion) and the
templates situated in another module specific to my node or platform.
So is there any way that I can use a template from another module? From my
understanding of how puppet compiles the catalogue I cannot see why it
wouldn't work?
Thanks
Josh
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/fN6PaZTExigJ.
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.