我有这个puppet模块(monit),我在其中声明启用monit服务(a.k.a在机器启动时启动)
class monit {
$configdir = "/etc/monit.d"
package {
"monit": ensure => installed;
}
service { "monit":
ensure => running,
enable => true,
require => Package["monit"],
provider => init;
}
file {
'/etc/monit.d':
ensure => directory;
'/etc/monit.conf':
content => template('monit/monitrc.erb'),
mode => 0600,
group => root,
require => File['/etc/monit.d'],
before => Service[monit],
notify => Service[monit],
}
}
然后我将include monit
包含在默认节点中。
但是,当我应用此配置时,puppet没有将monit设置为启动服务(使用chkconfig --list monit只显示'off'和'off')
但是,如果我运行puppet apply -e 'service { "monit": enable => true, } '
,则会添加monit以正常启动。
我在这里做错了吗? (Puppet 2.7.6)
查看完整配置