<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">playbook, tags</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2.4.0"><pre class="notranslate"><code class="notranslate">2.4.0
</code></pre></div>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">Fact_gathering is run for plays that do not match a tag.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- hosts: node-1
  gather_facts: yes
  tags:
    - node-tag"><pre class="notranslate">- <span class="pl-ent">hosts</span>: <span class="pl-s">node-1</span>
  <span class="pl-ent">gather_facts</span>: <span class="pl-s">yes</span>
  <span class="pl-ent">tags</span>:
    - <span class="pl-s">node-tag</span></pre></div>
<p dir="auto">To skip the play run either<br>
<code class="notranslate">ansible-playbook -i node-1, play.yml --skip-tags="node-tag"</code><br>
or<br>
<code class="notranslate">ansible-playbook -i node-1, play.yml --tags="mismatch"</code></p>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">Works fine with <code class="notranslate">--skip tags=node-tag</code>:  the play is matched and skipped.<br>
I have expected the same behaviour with --tags=mismatch.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">When run with <code class="notranslate">--tags=mismatch</code>, the play is mismatched and is skipped. However, ansible still tries to gather the facts. It fails because node-1 does not exist.</p>
<p dir="auto">With modules taking advantage of module_utils/{ec2,rax}.py there is a lot of duplicated documentation that has to be managed per module.  This is especially true of the rax modules.</p>
<p dir="auto">Currently all rax modules, have documentation references to the following attributes:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    api_key
    credentials
    region
    username"><pre class="notranslate"><code class="notranslate">    api_key
    credentials
    region
    username
</code></pre></div>
<p dir="auto">The docs for these get copy/pasted into all new modules.  Additionally the 'notes' portion of the DOCUMENTATION is identical or should be identical between all rax modules.</p>
<p dir="auto">I'm not sure if it possible, but I am wondering if we could find a way to not have to duplicate all of those docs.</p>
<p dir="auto">Especially, as I have plans to add a bit more standard attributes for all rax modules that revolve around authentication.</p>
<p dir="auto">Since currently we just open/read the module files and parse with ast I don't have an answer for this, and haven't dug into it deeply, but if there are any recommendations, I'd be happy to look into the required changes.</p>