<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">core</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.5.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/ici/home/yves/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.14 (default, Sep 20 2017, 01:25:59) [GCC 7.2.0]"><pre class="notranslate"><code class="notranslate">ansible 2.5.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/ici/home/yves/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.14 (default, Sep 20 2017, 01:25:59) [GCC 7.2.0]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ANSIBLE_SSH_PIPELINING(/etc/ansible/ansible.cfg) = True"><pre class="notranslate"><code class="notranslate">ANSIBLE_SSH_PIPELINING(/etc/ansible/ansible.cfg) = True
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Up-to-date Archlinux</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">I have writen more than 50 Ansible roles, with the aim of installing/updating my home-server. It works nice.<br>
But running the whole book takes <em><strong>very</strong></em> long! One reason it takes so long is that some roles that I include using <code class="notranslate">include_role</code> get often repeated needlessly (no change) at places where I do not expect them to run.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">I tried to minimally reproduce the problem, and I came up with this:<br>
<a href="https://yalis.fr/git/yves/ansible-repeated-tasks-showcase" rel="nofollow">https://yalis.fr/git/yves/ansible-repeated-tasks-showcase</a></p>
<p dir="auto">In short:</p>
<ul dir="auto">
<li><code class="notranslate">nfs</code> and <code class="notranslate">postgresql</code> both depend on <code class="notranslate">cleanupdate</code>, which depends on <code class="notranslate">init</code></li>
<li>each of these may have “upstream” actions and “local” actions</li>
<li>the “upstream” actions are enclosed between:
<ul dir="auto">
<li>an <code class="notranslate">include_role</code> of <code class="notranslate">etckeeper.inc</code> with tasks from <code class="notranslate">upstream.yml</code></li>
<li>an <code class="notranslate">include_role</code> of <code class="notranslate">etckeeper.inc</code> with tasks from <code class="notranslate">merge.yml</code></li>
</ul>
</li>
<li>the “local” actions are followed by:
<ul dir="auto">
<li>an <code class="notranslate">include_role</code> of <code class="notranslate">etckeeper.inc</code> with tasks from <code class="notranslate">local.yml</code></li>
</ul>
</li>
<li>furthermore, <code class="notranslate">init</code> starts with:
<ul dir="auto">
<li>an <code class="notranslate">include_role</code> of <code class="notranslate">etckeeper.inc</code> with tasks from <code class="notranslate">init.yml</code></li>
</ul>
</li>
</ul>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">I expect the following sequence of actions:</p>
<ol dir="auto">
<li>load role <code class="notranslate">nfs</code> and see its <code class="notranslate">meta/</code> dependencies, for instance <code class="notranslate">cleanupdate</code></li>
<li>load role <code class="notranslate">cleanupdate</code> and see its <code class="notranslate">meta/</code> dependencies, for instance <code class="notranslate">init</code></li>
<li>load role <code class="notranslate">init</code> and see its <code class="notranslate">meta/</code> dependencies, for instance none</li>
<li>run <code class="notranslate">init</code>, then <code class="notranslate">cleanupdate</code>, then <code class="notranslate">nfs</code></li>
<li>load role <code class="notranslate">postgresql</code> and see its <code class="notranslate">meta/</code> dependencies, for instance <code class="notranslate">cleanupdate</code></li>
<li><code class="notranslate">cleanupdate</code> has already ran, so skip it</li>
<li>run <code class="notranslate">postgresql</code></li>
</ol>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">Instead of the 6th step, I see a bunch of runs of tasks from <code class="notranslate">etckeeper.inc</code>, which is exactly what I see with my big, real, Ansible setup. And this is only a minimal example with 2 roles and simplified meta-dependencies…</p>
<p dir="auto">The actual, annotated, output of <code class="notranslate">ansible-playbook -i production site.yml</code> can be seen here:<br>
<a href="https://yalis.fr/git/yves/ansible-repeated-tasks-showcase/src/master/ansible-playbook.log" rel="nofollow">https://yalis.fr/git/yves/ansible-repeated-tasks-showcase/src/master/ansible-playbook.log</a></p>
<p dir="auto">I am trying to use ansible, unfortunately It does not work with my list of hosts defined in .ssh/config.</p>
<p dir="auto">In paramiko mode - my hosts are throwing "Name of service not known" - my /etc/ansible/hosts file refers to aliases defined in .ssh/config.</p>
<p dir="auto">In -c ssh - it tries connect to default 22 port, instead of the ones defines in .ssh/config</p>