<h5 dir="auto">Issue Type:</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">Ansible Version:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.0.1.0"><pre class="notranslate"><code class="notranslate">ansible 2.0.1.0
</code></pre></div>
<h5 dir="auto">Ansible Configuration:</h5>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Mac OSX</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Using tags inside included files and access the tags as variable was working in version 1.7.2. In later version this is broken.</p>
<p dir="auto">Note: The debug/print statements below are only in there to show the issue (tags not being able to be accessed as variable). The actual issue is that the tags was able to be used in when clause but now is not able to.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<ol dir="auto">
<li>Create two files as below one yaml includes the other.</li>
<li>ansible-playbook ./anstest.yml</li>
</ol>
<p dir="auto">anstest.yml</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- name: Test tags in when caluse
  hosts: localhost
  tasks:
    - { include: anstest1.yml, tags: ['removefromlb'] }"><pre class="notranslate"><code class="notranslate">
---
- name: Test tags in when caluse
  hosts: localhost
  tasks:
    - { include: anstest1.yml, tags: ['removefromlb'] }
</code></pre></div>
<p dir="auto">anstest1.yml</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---

  - debug: msg=&quot;tags yo {{tags}}&quot; # tags could be printed as variable - worked in 1.7.1 - doesn't work in 1.9.1 or 2.0

  - name: Remove from lb   # how it was being used - worked in 1.7.1 - doesn't work in 1.9.1 or 2.0
    debug: msg=&quot;hello world&quot;
    tags: removefromlb
    when: &quot;'removefromlb' in tags&quot;"><pre class="notranslate"><code class="notranslate">
---

  - debug: msg="tags yo {{tags}}" # tags could be printed as variable - worked in 1.7.1 - doesn't work in 1.9.1 or 2.0

  - name: Remove from lb   # how it was being used - worked in 1.7.1 - doesn't work in 1.9.1 or 2.0
    debug: msg="hello world"
    tags: removefromlb
    when: "'removefromlb' in tags"
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">Not error.</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">Errors out with not being able to print tags variable which leads to issues around usage in when clause.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [Test tags in when caluse] ************************************************

TASK [setup] *******************************************************************
ESTABLISH LOCAL CONNECTION FOR USER: alvins
127.0.0.1 EXEC /bin/sh -c '( umask 22 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115 `&quot; &amp;&amp; echo &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115 `&quot; )'
127.0.0.1 PUT /var/folders/gq/j5yrkds57zl8p5kt4fnj1xw00000gp/T/tmpbkzOcR TO /Users/alvins/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115/setup
127.0.0.1 EXEC /bin/sh -c 'LANG=en_AU.UTF-8 LC_ALL=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8 /usr/bin/python /Users/alvins/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115/setup; rm -rf &quot;/Users/alvins/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115/&quot; &gt; /dev/null 2&gt;&amp;1'
ok: [localhost]

TASK [include] *****************************************************************
task path: /Users/alvins/git/pocketbook-servers/playbooks-aws/anstest.yml:9
included: /Users/alvins/git/pocketbook-servers/playbooks-aws/anstest1.yml for localhost

TASK [debug] *******************************************************************
task path: /Users/alvins/git/pocketbook-servers/playbooks-aws/anstest1.yml:3
fatal: [localhost]: FAILED! =&gt; {&quot;failed&quot;: true, &quot;msg&quot;: &quot;'tags' is undefined&quot;}
    to retry, use: --limit @./anstest.retry

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1   "><pre class="notranslate"><code class="notranslate">PLAY [Test tags in when caluse] ************************************************

TASK [setup] *******************************************************************
ESTABLISH LOCAL CONNECTION FOR USER: alvins
127.0.0.1 EXEC /bin/sh -c '( umask 22 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115 `" &amp;&amp; echo "` echo $HOME/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115 `" )'
127.0.0.1 PUT /var/folders/gq/j5yrkds57zl8p5kt4fnj1xw00000gp/T/tmpbkzOcR TO /Users/alvins/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115/setup
127.0.0.1 EXEC /bin/sh -c 'LANG=en_AU.UTF-8 LC_ALL=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8 /usr/bin/python /Users/alvins/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115/setup; rm -rf "/Users/alvins/.ansible/tmp/ansible-tmp-1457499884.38-255223301464115/" &gt; /dev/null 2&gt;&amp;1'
ok: [localhost]

TASK [include] *****************************************************************
task path: /Users/alvins/git/pocketbook-servers/playbooks-aws/anstest.yml:9
included: /Users/alvins/git/pocketbook-servers/playbooks-aws/anstest1.yml for localhost

TASK [debug] *******************************************************************
task path: /Users/alvins/git/pocketbook-servers/playbooks-aws/anstest1.yml:3
fatal: [localhost]: FAILED! =&gt; {"failed": true, "msg": "'tags' is undefined"}
    to retry, use: --limit @./anstest.retry

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1   
</code></pre></div>
<h5 dir="auto">Issue Type:</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible-playbook 2.0.0.2</p>
<h5 dir="auto">Ansible Configuration:</h5>
<p dir="auto">nothing special</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Debian 8.2</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Ansible-playbook option --list-tags shows no tags</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">ansible-playbook -i inventories/tad-hosts 05-apache.yml -l tadprsc01 --list-tags</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">playbook: 05-apache.yml</p>
<p dir="auto">play <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3525390" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/1" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/1/hovercard" href="https://github.com/ansible/ansible/issues/1">#1</a> (apache-hosts):       TAGS: [tag1,tag2,tag3]<br>
TASK TAGS: [tag1,tag2,tag3]</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">playbook: 05-apache.yml</p>
<p dir="auto">play <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3525390" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/1" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/1/hovercard" href="https://github.com/ansible/ansible/issues/1">#1</a> (apache-hosts):       TAGS: []<br>
TASK TAGS: []</p>