You can't do this with a normal resource type -- $title will always be the 
title of the surrounding container. 

So the solution is to interpose another container. Make a defined type that 
just acts as a macro here. 

# /etc/puppetlabs/puppet/modules/monit/manifests/rcfile.pp
define monit::rcfile {
        file { $title:
                path => "/opt/monit/etc/conf.d/*$title*.rc",
                ensure => file,
                content => template("monit/*$title*.rc.erb"),
                before => Service['monit'],
        }
}

# /etc/puppetlabs/puppet/modules/monit/manifests/monit.pp

...
...
monit::rcfile { $server_types: }

See?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-dev/-/2wtAsMdZzUcJ.
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-dev?hl=en.

Reply via email to