service state=restarted: Documentation wrong? Or behaviour wrong?

“Service” documentation indicates “restarted” is not idempotent:

‘started’, ‘stopped’, ‘reloaded’, or ‘restarted’. Started/stopped are idempotent actions that will not run commands unless neccessary. ‘restarted’ will always bounce the service, ‘reloaded’ will always reload.

Playbook:

action: service name=hadoop-hdfs-namenode state=restarted

Actual behaviour:

failed: [10.20.30.40] => {“changed”: false, “failed”: true, “msg”: “failed determining the current service state => state stays unchanged”}

Aside: this is during installation/configuration of HBase, which seems to have broken “service” scripts and will possibly never return proper state. Would like to be able to install HBase anyway.

sounds like you were using upstart and need to update

https://github.com/ansible/ansible/issues/1067

Thanks for the URL. I’ve read it with great fascination and I think you’re right. I’m on the latest Ansible now (but I also think I worked around the problem using a pattern=).