<h5 dir="auto">ISSUE TYPE</h5>
<p dir="auto">bug report</p>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ec2_group module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">ansible 1.9.0.1<br>
configured module search path = None</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">OSX</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Running an ec2_group task fails if the group already exists if and it contains a rule with a cidr_ip that is not either 0.0.0.0/0 or of the form x.x.x.x/32. Rules with cidr_ips such as x.x.x.x/24 succeed the first time, then fail on subsequent runs.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Comment in one of the cidr_ip lines to create a task that will either be idempotent or not, as indicated:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: Create security group
  ec2_group:
    name: &quot;foo&quot;
    description: test security group
    region: eu-west-1
    rules:
      - proto: tcp
        from_port: 80
        to_port: 80
        # cidr_ip: 0.0.0.0/0              # succeeds on repeated runs
        # cidr_ip: 194.82.50.2/32    # succeeds on repeated runs
        # cidr_ip: 194.82.50.2/24    # succeeds first time, then fails on repeated runs
        # cidr_ip: 194.82.50.2/25    # succeeds first time, then fails on repeated runs"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">Create security group</span>
  <span class="pl-ent">ec2_group</span>:
    <span class="pl-ent">name</span>: <span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>
    <span class="pl-ent">description</span>: <span class="pl-s">test security group</span>
    <span class="pl-ent">region</span>: <span class="pl-s">eu-west-1</span>
    <span class="pl-ent">rules</span>:
      - <span class="pl-ent">proto</span>: <span class="pl-s">tcp</span>
        <span class="pl-ent">from_port</span>: <span class="pl-c1">80</span>
        <span class="pl-ent">to_port</span>: <span class="pl-c1">80</span>
        <span class="pl-c"><span class="pl-c">#</span> cidr_ip: 0.0.0.0/0              # succeeds on repeated runs</span>
        <span class="pl-c"><span class="pl-c">#</span> cidr_ip: 194.82.50.2/32    # succeeds on repeated runs</span>
        <span class="pl-c"><span class="pl-c">#</span> cidr_ip: 194.82.50.2/24    # succeeds first time, then fails on repeated runs</span>
        <span class="pl-c"><span class="pl-c">#</span> cidr_ip: 194.82.50.2/25    # succeeds first time, then fails on repeated runs</span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] **************************************************************

TASK: [foo | Create security group] *******************************************
ok: [localhost]

PLAY RECAP ********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0"><pre class="notranslate"><code class="notranslate">PLAY [localhost] **************************************************************

TASK: [foo | Create security group] *******************************************
ok: [localhost]

PLAY RECAP ********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] **************************************************************

TASK: [foo | Create security group] *******************************************
failed: [localhost] =&gt; {&quot;failed&quot;: true, &quot;parsed&quot;: false}
Traceback (most recent call last):
  File &quot;/Users/rsslldnphy/.ansible/tmp/ansible-tmp-1427989467.61-110551427980538/ec2_group&quot;, line 2187, in &lt;module&gt;
    main()
  File &quot;/Users/rsslldnphy/.ansible/tmp/ansible-tmp-1427989467.61-110551427980538/ec2_group&quot;, line 302, in main
    group.authorize(rule['proto'], rule['from_port'], rule['to_port'], ip, grantGroup)
  File &quot;/usr/local/lib/python2.7/site-packages/boto/ec2/securitygroup.py&quot;, line 203, in authorize
    dry_run=dry_run)
  File &quot;/usr/local/lib/python2.7/site-packages/boto/ec2/connection.py&quot;, line 3191, in authorize_security_group
    params, verb='POST')
  File &quot;/usr/local/lib/python2.7/site-packages/boto/connection.py&quot;, line 1226, in get_status
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;Response&gt;&lt;Errors&gt;&lt;Error&gt;&lt;Code&gt;InvalidPermission.Duplicate&lt;/Code&gt;&lt;Message&gt;the specified rule &quot;peer: 194.82.50.0/24, TCP, from port: 80, to port: 80, ALLOW&quot; already exists&lt;/Message&gt;&lt;/Error&gt;&lt;/Errors&gt;&lt;RequestID&gt;7b8b6394-82d5-422d-a037-0aa90c4f0edd&lt;/RequestID&gt;&lt;/Response&gt;


FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/Users/rsslldnphy/web.retry

localhost                  : ok=0    changed=0    unreachable=0    failed=1"><pre class="notranslate"><code class="notranslate">PLAY [localhost] **************************************************************

TASK: [foo | Create security group] *******************************************
failed: [localhost] =&gt; {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/Users/rsslldnphy/.ansible/tmp/ansible-tmp-1427989467.61-110551427980538/ec2_group", line 2187, in &lt;module&gt;
    main()
  File "/Users/rsslldnphy/.ansible/tmp/ansible-tmp-1427989467.61-110551427980538/ec2_group", line 302, in main
    group.authorize(rule['proto'], rule['from_port'], rule['to_port'], ip, grantGroup)
  File "/usr/local/lib/python2.7/site-packages/boto/ec2/securitygroup.py", line 203, in authorize
    dry_run=dry_run)
  File "/usr/local/lib/python2.7/site-packages/boto/ec2/connection.py", line 3191, in authorize_security_group
    params, verb='POST')
  File "/usr/local/lib/python2.7/site-packages/boto/connection.py", line 1226, in get_status
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Response&gt;&lt;Errors&gt;&lt;Error&gt;&lt;Code&gt;InvalidPermission.Duplicate&lt;/Code&gt;&lt;Message&gt;the specified rule "peer: 194.82.50.0/24, TCP, from port: 80, to port: 80, ALLOW" already exists&lt;/Message&gt;&lt;/Error&gt;&lt;/Errors&gt;&lt;RequestID&gt;7b8b6394-82d5-422d-a037-0aa90c4f0edd&lt;/RequestID&gt;&lt;/Response&gt;


FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/Users/rsslldnphy/web.retry

localhost                  : ok=0    changed=0    unreachable=0    failed=1
</code></pre></div>
<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="65955056" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/1068" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/1068/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/1068">ansible/ansible-modules-core#1068</a></p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">yum</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">CentOS release 6.9 (Final) on source and target.</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">When yum has error about "Warning: RPMDB altered outside of yum", ansible's yum command fails with "Failure talking to yum: list index out of range".</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="- name: install anything with yum
  yum: name={{ item }} state=present
  with_items:
   - nodejs
   # or any package"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">install anything with yum</span>
  <span class="pl-ent">yum</span>: <span class="pl-s">name={{ item }} state=present</span>
  <span class="pl-ent">with_items</span>:
   - <span class="pl-s">nodejs</span>
   <span class="pl-c"><span class="pl-c">#</span> or any package</span></pre></div>
<p dir="auto">On target, someone installed an rpm manually, outside of yum. So running <code class="notranslate">yum history list</code> returns the history, followed by the message "Warning: RPMDB altered outside of yum."</p>
<p dir="auto">As far as I understand it, this situation shouldn't prevent you from installing new things with yum.</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Installs new package</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="failed: [stats.dev.scivantage.com] (item=[u'nodejs']) =&gt; {&quot;failed&quot;: true, &quot;item&quot;: [&quot;nodejs&quot;], &quot;msg&quot;: &quot;Failure talking to yum: list index out of range&quot;}"><pre class="notranslate"><code class="notranslate">failed: [stats.dev.scivantage.com] (item=[u'nodejs']) =&gt; {"failed": true, "item": ["nodejs"], "msg": "Failure talking to yum: list index out of range"}
</code></pre></div>
<p dir="auto">After fixing the condition on the target (by running <code class="notranslate">rpm --rebuilddb</code>, <code class="notranslate">yum clean all</code>, then installing something manually with yum), the ansible command worked again.</p>