<h5 dir="auto">ISSUE TYPE</h5>
<p dir="auto">Feature Request</p>
<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="I just built from stable-2.1 branch
ansible 2.1.1.0
config file = /mnt/c/Users/james/Dropbox/aftermath/ansible-repo/ansible.cfg
configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">I just built from stable-2.1 branch
ansible 2.1.1.0
config file = /mnt/c/Users/james/Dropbox/aftermath/ansible-repo/ansible.cfg
configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Host patterns that include intersections end up applying the intersection onto all patterns.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Applicable groups:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[backend]
lana
[preagg]
akira
[dev-network]
lana
[cassandra_live_dcs]
akira"><pre class="notranslate"><code class="notranslate">[backend]
lana
[preagg]
akira
[dev-network]
lana
[cassandra_live_dcs]
akira
</code></pre></div>
<p dir="auto">Hosts from affected play</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts:
    - backend:&amp;cassandra_live_dcs:&amp;dev-network
    - preagg"><pre class="notranslate"><code class="notranslate">- hosts:
    - backend:&amp;cassandra_live_dcs:&amp;dev-network
    - preagg
</code></pre></div>
<p dir="auto">Even though <code class="notranslate">preagg</code> is it's own pattern, it's being intersected with the groups from the first pattern. If I comment out the first hosts pattern, then <code class="notranslate">akira</code> is correctly run. Since <code class="notranslate">akira</code> is also in <code class="notranslate">cassandra_live_dcs</code>, if I remove <code class="notranslate">:&amp;dev-network</code> then it works correctly.</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Since <code class="notranslate">akira</code> is in <code class="notranslate">preagg</code> I would expect it to have the play run on it.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">Output from <code class="notranslate">--list-hosts</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(backend:&amp;cassandra_live_dcs:&amp;dev-network,preagg): backend:&amp;cassandra_live_dcs:&amp;dev-network,preagg    TAGS: [analyticsapi-preagg]
    pattern: [u'backend:&amp;cassandra_live_dcs:&amp;dev-network', u'preagg']
    hosts (1):
     lana"><pre class="notranslate"><code class="notranslate">(backend:&amp;cassandra_live_dcs:&amp;dev-network,preagg): backend:&amp;cassandra_live_dcs:&amp;dev-network,preagg    TAGS: [analyticsapi-preagg]
    pattern: [u'backend:&amp;cassandra_live_dcs:&amp;dev-network', u'preagg']
    hosts (1):
     lana
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">rabbitmq_exchange</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.1.0
  config file = 
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
"><pre class="notranslate"><code class="notranslate">ansible 2.3.1.0
  config file = 
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">plain</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">xenial 64bit localhost</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">rabbitmq_exchange after creating an exchange the HTTP response is <code class="notranslate">201</code> and is interpreted as an error.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<ol dir="auto">
<li>install rabbitmq 3.6.10</li>
<li>run an ansible local on using a playbook like this</li>
</ol>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: creating test exchanges
  become: yes
  rabbitmq_exchange:
    name: test"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">creating test exchanges</span>
  <span class="pl-ent">become</span>: <span class="pl-s">yes</span>
  <span class="pl-ent">rabbitmq_exchange</span>:
    <span class="pl-ent">name</span>: <span class="pl-s">test</span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">creating an exchange.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fatal: [rabbitmq-1]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;details&quot;: &quot;&quot;, &quot;failed&quot;: true, &quot;msg&quot;: &quot;Error creating exchange&quot;, &quot;status&quot;: 201}
"><pre class="notranslate"><code class="notranslate">fatal: [rabbitmq-1]: FAILED! =&gt; {"changed": false, "details": "", "failed": true, "msg": "Error creating exchange", "status": 201}

</code></pre></div>
<h3 dir="auto">SOLUTION</h3>
<p dir="auto">actually the exchange is created need to be replaced the check with <code class="notranslate">201</code> instead of 201</p>
<p dir="auto">probably it is required to do both due to the fact of backward compatibility of precedent version of RabbitMQ.</p>