I'm just getting my feet wet with Ansible 2.2 and Debops and I've run into the following problem. I have a host test-host to which I deployed a MySQL server (using geerlingguy.mysql).
The role uses the following handler to restart the service:
---
- name: restart mysql
service: "name={{ mysql_daemon }} state=restarted sleep=5"
which, I thought, uses Ansibles service module to restart the server. However, that fails:
unsupported parameter for module: sleep
So just to rule out any weirdness with that custom role, I've tried to execute the module directly like so:
ansible test-host -b -m service -a 'name=mysql sleep=5 state=restarted'
with the same result.
Running Ansible with more verbose output shows (among other things):
Running systemd
Using module file /usr/local/lib/python2.7/site-packages/ansible-2.2.0-py2.7.egg/ansible/modules/core/system/systemd.py
So it appears that the systemd module is used instead of service (looking into the module shows that it is indeed aliased to service). And, lo and behold, systemd does not support the sleep parameter.
How to fix this?
v2.1.0.0-1. The second is to raise an issue on github.com/ansible/ansible-modules-core/issues if it does not already exist since this is clearly not expected behavior. - Matt Schuchard