Когда услуга описывается обоими ensure => running
и подписался на изменения файла конфигурации, если выполняются оба условия (то есть он не запущен и файл конфигурации изменен), он запускается (повторно) дважды. Есть ли способ запустить его только один раз?
Чтобы уточнить, у меня есть такой тип:
service { "puppet":
ensure => running,
enable => true,
hasrestart => true,
subscribe => File["/etc/puppet/puppet.conf"],
} # service
когда обе /etc/puppet/puppet.conf
изменено, а марионетка службы не запущена. В выходных данных марионетки (с указанием --debug) отображается следующее:
....
debug: /Stage[main]/Puppet/Service[puppet]/subscribe: subscribes to File[/etc/puppet/puppet.conf]
notice: /Stage[main]/Puppet/File[/etc/puppet/puppet.conf]/content: content changed '{md5}c39350dd1e135cf9fffd14ff167d6655' to '{md5}845a4aac5e83ab3f8cd9efd80ce17772'
....
info: /etc/puppet/puppet.conf: Scheduling refresh of Service[puppet]
debug: /etc/puppet/puppet.conf: The container Class[Puppet] will propagate my refresh event
info: /etc/puppet/puppet.conf: Scheduling refresh of Service[puppet]
debug: Service[puppet](provider=debian): Executing '/etc/init.d/puppet status'
debug: Service[puppet](provider=debian): Executing '/etc/init.d/puppet start'
notice: /Stage[main]/Puppet/Service[puppet]/ensure: ensure changed 'stopped' to 'running'
debug: /Stage[main]/Puppet/Service[puppet]: The container Class[Puppet] will propagate my refresh event
debug: Service[puppet](provider=debian): Executing '/etc/init.d/puppet status'
debug: Service[puppet](provider=debian): Executing '/etc/init.d/puppet restart'
err: /Stage[main]/Puppet/Service[puppet]: Failed to call refresh: Could not restart Service[puppet]: Execution of '/etc/init.d/puppet restart' returned 1: at /etc/puppet/modules/puppet/manifests/init.pp:32
Очевидно, что это не удается по следующим причинам:
root:~# /etc/init.d/puppet restart ; /etc/init.d/puppet restart
* Restarting puppet agent [ OK ]
* Restarting puppet agent [fail]
Есть ли способ с этим справиться?
IRC-канал Puppet ответил на мой вопрос.
Это ошибка Puppet, описанная здесь: http://projects.puppetlabs.com/issues/show/9656
На данный момент я не собираюсь устанавливать марионетку, но кое-что еще: