The init script is probably returning something unexpected.
Can you include output of the actual ansible command executing the service module? I don't see that below.
Also, latest ansible on development branch? What OS?
The init script is probably returning something unexpected.
Can you include output of the actual ansible command executing the service module? I don't see that below.
Also, latest ansible on development branch? What OS?
Unfortunately, the stunnel4 init script doesn’t support the ‘status’ command, which causes the service module to fail:
$ an server -m service -a ‘name=service state=started’
server | FAILED => failed to parse: {“msg”: “failed determining the current service state => state stays unchanged”, “failed”: true}
{“changed”: false}
I’m running ansible/devel (commit d453000193e2f…) against a Ubuntu 11.10 server.
I’ve tried running various flavors of starting the service:
an server -m shell -a ‘service stunnel4 start’
an server -m shell -a ‘/etc/init.d/stunnel4 start’
an server -a ‘service stunnel4 start’
an server -a ‘/etc/init.d/stunnel4 start’
All seem to result in the same problem.
Oli
Here's what puppet does when you pass the service module information that the service has no status command:
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/service/base.rb
basically it runs ps and checks for a given pattern in the ps output.
basically we could take a status=yes|no and support similar.
It would be a good option to deal with troublesome service init scripts, which are legion.
Patches for this would definitely be accepted.
I might give this a shot. I found the next cause of the problem, though, which is that using a pseudo-tty seems to prevent the stunnel binary from spawning children, so it’s not anything ansible handles. Not sure why at this point.
Is there any way to specify that ansible avoid using a pseudo-tty for it’s connection?
Paramiko at least, with sudo mode, has to do that.
Sounds like a problem with the init script to me?