问题原文
原帖链接 · Ville Mattila · CC BY-SA 3.0
Especially when setting up a completely new server from the scratch, puppet tends to start dependant services as soon as all their dependencies are satisfied. This sometimes leads to situation that services are started unnecessarily too early while the setup of other packages (not maybe dependant of a service) is still running.
Is there any one-liner definition or recipe that would automatically make all services to start/refresh in the end of the whole catalogue run? I tried to figure out if run stages could be utilized but that would, in my understanding, require that all service definitions are explicitly defined to "last" stage.
Update 1: Some background to my question. Puppet, during the initial setup of a node, works rather intensively and thus reserves resources of a fairly small virtual machine (in my case, Vagrant on dev machine). When the setup phase came to a point that some of the services, in my case the background workers, were ready, Puppet starts them and the workers start to receive jobs from a queue. This workload slows down the still-going-on Puppet node setup process as well as the Puppet slows down the workers, until the whole setup is done and the box is in a stable state.
This is why I started to think that it would be good to let Puppet to work the initial setup to its end before all services on the node are started and why I was wondering whether there is any simple way to do this with Puppet.
社区高分解答
原帖链接 · dmourati · CC BY-SA 3.0
I would advise against a global restart. Rather, use puppet dependencies.
Something like:
service { 'first':
ensure => running,
enable => true,
}
service { 'second':
ensure => running,
enable => true,
subscribe => Service['first']
}
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
