Ansible Service Restart Failed

Question:

I’ve been having some trouble with restarting the SSH daemon with Ansible.

I’m using the latest software as of May 11 2015 (Ansible 1.9.1 / Vagrant 1.7.2 / VirtualBox 4.3.26 / Host: OS X 10.10.1 / Guest: ubuntu/trusty64)

tl;dr: There appears to be something wrong with the way I’m invoking the service syntax.

Problem With Original Use Case (Handler)

Playbook

Output

The nginx handler completed successfully with nearly identical syntax.

Task Also Fails

Playbook

Same output as the handler use case.

Ad Hoc Command Also Fails

Shell

Inventory

Output

Shell command in box works

When I SSH in and run the usual command, everything works fine.

Command task also works

Output

As we can see in the warning, we’re supposed to use the service module, but I’m still not sure where the snag is.

Answer:

As the comments above state, this is an Ansible issue that will apparently be fixed in the 2.0 release.

I just changed my handler to use the command module and moved on:

Leave a Reply