Hi,
I wrote a puppet module for my monit agent. I want to put different rc file
for different server types.
One physical server could be multiple types, so I want the puppet can put
the different rc files into "/opt/monit/etc/conf.d" according to the
parameter "$server_types", which is an array.
But the debug result always show me the value of variable "$title" is
always the class name of "monit::monit", instead of the title of the Type
"file", which should be "a" or "b" in my case.
Why I can not get "a" or "b" in my code? And is there any other work around
to make it work?
BTW, I am using "2.7.11-1ubuntu2" on ubuntu 12.04.
I appreciate for any suggestions.
class monit::monit($server_types=['',],
$mmonit_ip,
$mmonit_port,
$mmonit_account,
$mmonit_passwd,
$monit_account,
$monit_passwd,
$bmc_server,
){
.................................
................................
file { $server_types:
path => "/opt/monit/etc/conf.d/*$title*.rc",
ensure => file,
content => template("monit/*$title*.rc.erb"),
before => Service['monit'],
}
}
$server_types = ['a', 'b']
class {'monit::monit':
server_types => $server_types,
.....
}
root@swft001:~# puppet agent -t
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find template 'monit/*monit::monit*.rc.erb' at
/etc/puppet/modules/monit/manifests/init.pp:77 on node swft001.webex.com
--
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/-/SOMjgNOH3LgJ.
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.