我对Puppet很新,但到目前为止我真的很喜欢它.现在我正在设置自动化小型架构.
原文链接:https://www.f2er.com/ubuntu/348533.html我有一个问题 – 我想删除一个包,并确保它已停止.为此,我在清单中有以下条目:
package { 'supervisor': ensure => absent,} service { 'supervisor': ensure => stopped,enable => false,hasstatus => true,}
这个问题是,一旦将清单应用于节点一次,我在下次运行时会收到以下错误:
debug: Service[supervisor](provider=debian): Could not find supervisor in /etc/init.d debug: Service[supervisor](provider=debian): Could not find supervisor.sh in /etc/init.d err: /Stage[main]/Screenly_core/Service[supervisor]: Could not evaluate: Could not find init script for 'supervisor'
有没有办法做某种条件语句,这样只有在程序包确实存在时才会执行stop-procedure(然后在删除程序包之前运行)?