Just to give a bit of context.
I'm working on a script to provision Mercurial.
There is an init script with "start" and "stop" capabilities.
I've written the following block to make sure the service is running.
service { 'hg_serve':
ensure => running,
enable => true,
}
I'm running into an issue where this service tries to start itself every time the above resource runs. But of course after the initial provisioning, the port is already in use, so all subsequent provisioning fails because it tries to start a mercurial server on the same port.
Isn't ensure supposed to just check its status, instead of starting it?
I think the service provider is failing to recognize the status of this service and that's why it just tries to start it "to get the job done".
I've been looking through the puppet source code but can't find where the checks for "ensure" is located.
↧