<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Feature Idea</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.5.4</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Debian 7</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Hi I'm using Debian and miss to be able to nicely add conditions which incorporates the state of a package, ie only run a command if a package is not installed. (in my caste debconf commands should only be run if the package is not installed)</p>
<p dir="auto">Got the idea from: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="31013808" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/6886" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/6886/hovercard" href="https://github.com/ansible/ansible/issues/6886">#6886</a> where a condition with debconf will always be "changed"</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">not able to retrieve status of a package to a variable today.</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">something like this below but you proably know syntax better than me :)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible -m apt -a name=mysql-server state=facts"><pre class="notranslate"><code class="notranslate">ansible -m apt -a name=mysql-server state=facts
</code></pre></div>
<p dir="auto">which would give me a variable back with the status if its installed or not.<br>
With this variable I can then run a command based upon if the package is missing or not. (when: variable=true) from my playbook.</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">not able to retrieve status of a package to a variable</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">Tags</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">hi, it would be very usefull if we could combine tags to restrict the execution on some task which have all the tags, instead of the union.</p>
<p dir="auto">That could be done with this kind of arguments:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-playbook -i &quot;localhost,&quot; -c local playbook.yml --tags=tag1 --tags=tag2 --tag-strategy=intersection"><pre class="notranslate"><code class="notranslate">ansible-playbook -i "localhost," -c local playbook.yml --tags=tag1 --tags=tag2 --tag-strategy=intersection
</code></pre></div>
<p dir="auto">And it would execute only the task with both tags.</p>
<p dir="auto">The same could be done with the skip-tags property.</p>
<p dir="auto">Thanks for your feedback.</p>