ansible/ansible — pull request #1096 by sfromm (2012-09-26 06:05:59+00:00)
Title: Ignore failure of stop command if start succeeds with state=restarted

In some cases (see issue #1067) with state=restarted, a failure to stop
the service (which wasn't running) would appear to the module to be a
failure to restart the service even though it successfully started the
service. This changes the behavior of the service module to focus
on the return code of the start command. If the rc of stop is not
0 and the rc of start does equal 0, it considers the service
successfully restarted. It then ignores the rc, stdout, and stderr
from the unsuccessful stop command.

Please let me know if you have any questions or comments.