<p dir="auto"><strong>Issue Type:</strong> Bug Report</p>
<p dir="auto"><strong>Ansible Version:</strong> ansible 1.9.3</p>
<p dir="auto"><strong>Environment:</strong> Debian Jessie x64</p>
<p dir="auto"><strong>Summary:</strong></p>
<p dir="auto">Recurrence of issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="43281192" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/9074" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/9074/hovercard" href="https://github.com/ansible/ansible/issues/9074">#9074</a>. The same steps may be used to reproduce this bug.</p>
<h5 dir="auto">Issue Type: Bug Report</h5>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">root@68b23fe4c544:~/Code/devel/tools/python/atlas# ansible --version<br>
ansible 1.9<br>
configured module search path = /usr/share/ansible:./modules</p>
<p dir="auto">root@68b23fe4c544:/opt/ansible-new# git log -p -1<br>
commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible-modules-core/commit/fb717ffd6c6afece578241fd43dce02e3287fab5/hovercard" href="https://github.com/ansible/ansible-modules-core/commit/fb717ffd6c6afece578241fd43dce02e3287fab5"><tt>fb717ff</tt></a><br>
Merge: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible-modules-core/commit/a68ca90a00ce7f21f4b2f9b961b508f356c1661e/hovercard" href="https://github.com/ansible/ansible-modules-core/commit/a68ca90a00ce7f21f4b2f9b961b508f356c1661e"><tt>a68ca90</tt></a> <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible-modules-core/commit/57c81dfcf7146597b8539a79be16fa03b932cc25/hovercard" href="https://github.com/ansible/ansible-modules-core/commit/57c81dfcf7146597b8539a79be16fa03b932cc25"><tt>57c81df</tt></a><br>
Author: Brian Coca <a href="mailto:bcoca@ansible.com">bcoca@ansible.com</a><br>
Date:   Fri Mar 6 11:45:07 2015 -0500</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Merge pull request #10345 from emonty/features/openstack-inventory-docs

Add documentation for the new OpenStack Inventory"><pre class="notranslate"><code class="notranslate">Merge pull request #10345 from emonty/features/openstack-inventory-docs

Add documentation for the new OpenStack Inventory
</code></pre></div>
<h5 dir="auto">Environment:</h5>
<p dir="auto">I am running ansible from within a cloudfoundry/lucid64:minbase Docker image. I installed ansible from git.</p>
<p dir="auto">The system that I am orchestrating is a Fedora 15 machine.</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Service module tries to use systemctl when it detects the system is using systemd, but the service I am trying to restart is using still using Sys V style init script. Further described ( including a possible fix ) on the ansible developer list ( see <a href="https://groups.google.com/forum/#!topic/ansible-devel/0ml1y6gkmEc" rel="nofollow">https://groups.google.com/forum/#!topic/ansible-devel/0ml1y6gkmEc</a> )</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">On the Fedora 15 system I am managing, auditd and sshd are both Sys V init scripts as well as our custom service init scripts.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts: fedora
  sudo: yes

  tasks:
    - service: name=auditd state=restarted enabled=yes"><pre class="notranslate"><code class="notranslate">- hosts: fedora
  sudo: yes

  tasks:
    - service: name=auditd state=restarted enabled=yes
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">I would expect the service module to recognize that the service is not managed by systemd and use rc.local or the init script to manage the service.</p>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK: [service name=auditd enabled=yes] ***************************************
&lt;10.17.217.203&gt; ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.17.217.203
&lt;10.17.217.203&gt; REMOTE_MODULE service name=auditd enabled=yes
&lt;10.17.217.203&gt; EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968'
&lt;10.17.217.203&gt; PUT /tmp/tmpAPdmFn TO /home/sgadmin/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968/service
&lt;10.17.217.203&gt; EXEC /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python /home/sgadmin/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968/service'
failed: [10.17.217.203] =&gt; {&quot;failed&quot;: true}
msg: Error when trying to enable auditd: rc=1 Unit name auditd is not a valid unit name.
Cannot install unit auditd: Invalid argument


FATAL: all hosts have already failed -- aborting"><pre class="notranslate"><code class="notranslate">TASK: [service name=auditd enabled=yes] ***************************************
&lt;10.17.217.203&gt; ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.17.217.203
&lt;10.17.217.203&gt; REMOTE_MODULE service name=auditd enabled=yes
&lt;10.17.217.203&gt; EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968'
&lt;10.17.217.203&gt; PUT /tmp/tmpAPdmFn TO /home/sgadmin/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968/service
&lt;10.17.217.203&gt; EXEC /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python /home/sgadmin/.ansible/tmp/ansible-tmp-1425923472.38-164975472934968/service'
failed: [10.17.217.203] =&gt; {"failed": true}
msg: Error when trying to enable auditd: rc=1 Unit name auditd is not a valid unit name.
Cannot install unit auditd: Invalid argument


FATAL: all hosts have already failed -- aborting
</code></pre></div>