<h5 dir="auto">ISSUE TYPE</h5>
<p dir="auto">Feature Idea</p>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">handlers</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.1.0"><pre class="notranslate"><code class="notranslate">ansible 2.1.1.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Duplicate handler task names causes task ordering to get messed up starting in 2.1.1. Ansible should instead error if it detects two or more handlers with the same task name.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">I expected systemd reload before restarting service foo. Instead, the order was reversed because of the duplicate handler task.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">Order was random. Sometimes good, but often it failed.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto">Ansible shouldn't permit duplicate handlers with the same task name to be used since it produces undesirable behavior.</p>
<p dir="auto">same problem as this closed ticket<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="69010378" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/10753" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/10753/hovercard" href="https://github.com/ansible/ansible/issues/10753">#10753</a></p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">1.9.4 and 2.0.1.0</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Mac OS X El Capitan</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">When adding a security group using the ec2_group module. A duplicate entry error is thrown.  This does not happen when using IP address with <code class="notranslate">cidr_ip</code>.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    - name: Update Security Group
      ec2_group:
        name: &quot;SSH Access&quot;
        description: &quot;Access To That Other Security Group&quot;
        region: &quot;{{ item.region }}&quot;
        rules:
          - proto: tcp
            from_port: 22
            to_port: 22
            group_id: some-other-group"><pre class="notranslate"><code class="notranslate">    - name: Update Security Group
      ec2_group:
        name: "SSH Access"
        description: "Access To That Other Security Group"
        region: "{{ item.region }}"
        rules:
          - proto: tcp
            from_port: 22
            to_port: 22
            group_id: some-other-group
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Duplicates should not trigger a play book failure.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">This error stops play book execution when using <code class="notranslate">group_id</code>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="An exception occurred during task execution. To see the full traceback, use -vvv. The error was: &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: sg-xxxxxx, TCP, from port: 22, to port: 22, ALLOW&quot; already exists&lt;/Message&gt;&lt;/Error&gt;&lt;/Errors&gt;"><pre class="notranslate"><code class="notranslate">An exception occurred during task execution. To see the full traceback, use -vvv. The error was: &lt;Response&gt;&lt;Errors&gt;&lt;Error&gt;&lt;Code&gt;InvalidPermission.Duplicate&lt;/Code&gt;&lt;Message&gt;the specified rule "peer: sg-xxxxxx, TCP, from port: 22, to port: 22, ALLOW" already exists&lt;/Message&gt;&lt;/Error&gt;&lt;/Errors&gt;
</code></pre></div>