<p dir="auto">Issue Type:</p>
<p dir="auto">Bug Report</p>
<p dir="auto">Ansible Version:</p>
<p dir="auto">1.9.0.1</p>
<p dir="auto">Environment:</p>
<p dir="auto">Managing CentOS 6 from MacOS X 10.10.2</p>
<p dir="auto">Summary:</p>
<p dir="auto">The service module is failing to start an upstart service on CentOS 6</p>
<p dir="auto">Steps To Reproduce:</p>
<p dir="auto">ansible hostname -m service -a 'name=servicename state=started'</p>
<p dir="auto">Expected Results:</p>
<p dir="auto">I expected ansible to start the service. This works on 1.8.4, but fails on 1.9.0.1.</p>
<p dir="auto">Actual Results:</p>
<p dir="auto">Ansible fails with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible ns1.ams.as112.ripe.net -u root -m service -a 'name=ansible state=started'
ns1.ams.as112.ripe.net | FAILED &gt;&gt; {
    &quot;failed&quot;: true, 
    &quot;msg&quot;: &quot;ansible: unrecognized service\n&quot;
}"><pre class="notranslate"><code class="notranslate">$ ansible ns1.ams.as112.ripe.net -u root -m service -a 'name=ansible state=started'
ns1.ams.as112.ripe.net | FAILED &gt;&gt; {
    "failed": true, 
    "msg": "ansible: unrecognized service\n"
}
</code></pre></div>
<p dir="auto"><strong>Issue Type:</strong><br>
Bug Report</p>
<p dir="auto"><strong>Ansible Version:</strong><br>
ansible 1.7.2 (1.7.2+dfsg-2~bpo70+1)</p>
<p dir="auto"><strong>Environment:</strong><br>
Debian 7.7</p>
<p dir="auto"><strong>Summary:</strong><br>
Today i try to split our grown ansible roles in more simple roles.<br>
After do some work i realize that after rewrite and set some dependencies in our roles, some roles got executed multiple times.<br>
So i google a bit and found an bug report (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="27426077" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/5971" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/5971/hovercard" href="https://github.com/ansible/ansible/issues/5971">#5971</a>) which descibe the same behavior.<br>
The bug gets closed because of not reproducable and no further information.</p>
<p dir="auto">So i recreate the simple test in comment nr. 4 and BAM...no duplicate running!<br>
After some testing i figured out the only difference to our plays.<br>
The duplicate run is triggered if you add some tags to the play.</p>
<p dir="auto">As sugested in <a href="https://groups.google.com/d/msg/ansible-project/3Tc6MUZ1dFI/JHFNplVccxcJ" rel="nofollow">https://groups.google.com/d/msg/ansible-project/3Tc6MUZ1dFI/JHFNplVccxcJ</a> i've open this bug report.</p>
<p dir="auto"><strong>Steps To Reproduce:</strong><br>
run without duplicates:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# test.yml

---
- name: dependency test
  gather_facts: false
  hosts: localhost
  connection: local

  roles:
    - { role: base }
    - { role: feature }

# roles/base/meta/main.yml

---

# roles/base/tasks/main.yml

---
- name: in base
  debug: msg=&quot;here we are in base&quot;

# roles/feature/meta/main.yml

---
dependencies:
  - { role: base }

# roles/feature/tasks/main.yml

---
- name: in feature
  debug: msg=&quot;here we are in feature&quot;

PLAY [dependency test] ********************************************************

TASK: [base | in base] ********************************************************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;here we are in base&quot;
}

TASK: [feature | in feature] **************************************************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;here we are in feature&quot;
}

PLAY RECAP ********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0"><pre class="notranslate"><code class="notranslate"># test.yml

---
- name: dependency test
  gather_facts: false
  hosts: localhost
  connection: local

  roles:
    - { role: base }
    - { role: feature }

# roles/base/meta/main.yml

---

# roles/base/tasks/main.yml

---
- name: in base
  debug: msg="here we are in base"

# roles/feature/meta/main.yml

---
dependencies:
  - { role: base }

# roles/feature/tasks/main.yml

---
- name: in feature
  debug: msg="here we are in feature"

PLAY [dependency test] ********************************************************

TASK: [base | in base] ********************************************************
ok: [localhost] =&gt; {
    "msg": "here we are in base"
}

TASK: [feature | in feature] **************************************************
ok: [localhost] =&gt; {
    "msg": "here we are in feature"
}

PLAY RECAP ********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0
</code></pre></div>
<p dir="auto">run with duplicates:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# test.yml

---
- name: dependency test
  gather_facts: false
  hosts: localhost
  connection: local

  roles:
    - { role: base, tags: base }
    - { role: feature, tags: feature }

# roles/base/meta/main.yml

---

# roles/base/tasks/main.yml

---
- name: in base
  debug: msg=&quot;here we are in base&quot;

# roles/feature/meta/main.yml

---
dependencies:
  - { role: base }

# roles/feature/tasks/main.yml

---
- name: in feature
  debug: msg=&quot;here we are in feature&quot;

PLAY [dependency test] ********************************************************

TASK: [base | in base] ********************************************************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;here we are in base&quot;
}

TASK: [base | in base] ********************************************************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;here we are in base&quot;
}

TASK: [feature | in feature] **************************************************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;here we are in feature&quot;
}

PLAY RECAP ********************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0"><pre class="notranslate"><code class="notranslate"># test.yml

---
- name: dependency test
  gather_facts: false
  hosts: localhost
  connection: local

  roles:
    - { role: base, tags: base }
    - { role: feature, tags: feature }

# roles/base/meta/main.yml

---

# roles/base/tasks/main.yml

---
- name: in base
  debug: msg="here we are in base"

# roles/feature/meta/main.yml

---
dependencies:
  - { role: base }

# roles/feature/tasks/main.yml

---
- name: in feature
  debug: msg="here we are in feature"

PLAY [dependency test] ********************************************************

TASK: [base | in base] ********************************************************
ok: [localhost] =&gt; {
    "msg": "here we are in base"
}

TASK: [base | in base] ********************************************************
ok: [localhost] =&gt; {
    "msg": "here we are in base"
}

TASK: [feature | in feature] **************************************************
ok: [localhost] =&gt; {
    "msg": "here we are in feature"
}

PLAY RECAP ********************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0
</code></pre></div>
<p dir="auto"><strong>Expected Results:</strong><br>
If the playbook is run, and the roles are tagged the dependencys should run only once.</p>
<p dir="auto"><strong>Actual Results:</strong><br>
If the playbook is run, and the roles are tagged the dependencys run multiple times.</p>