New to puppet and I just don't understand how to do this. Apologies in
advance if it's a dumb question.
Let's say I have a module called httpd and inside that is a class
called httpd::service, which accepts a couple of parameters:
class httpd::service (
$running = 'running',
$enabled = 'true',
) {
service { "httpd":
path => "/etc/init.d/httpd",
ensure => $running,
enable => $enabled,
require => [ Package[ "httpd" ], File[ "/etc/httpd/conf/httpd.conf" ] ],
subscribe => File[ "/etc/httpd/conf/httpd.conf" ],
}
}
But let's say that I want to allow the option of both requiring and
subscribing to a second file -- any file -- in addition to httpd.conf.
If I were doing this in a procedural language, I'd probably do
something naive and create a couple of empty parameters called
$also_subscribed and $myfile_path, use a conditional to see if it's
defined, then create the arguments to require and subscribe based on
that.
I cannot figure out how to get this done in puppet. Any help is
appreciated, even a link to an appropriate doc or example. Thanks!
--
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.