<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kabo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kabo">@kabo</a> on 2015-12-18T13:49:27Z</p>
<h5 dir="auto">ISSUE TYPE</h5>
<p dir="auto">Feature Idea</p>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">new module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">AWS has released support for <a href="https://aws.amazon.com/blogs/aws/new-managed-nat-network-address-translation-gateway-for-aws/" rel="nofollow">Managed NAT Gateways</a>. It would be nice if one could set them up with Ansible.</p>
<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="122951945" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-extras/issues/1401" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-extras/issues/1401/hovercard" href="https://github.com/ansible/ansible-modules-extras/issues/1401">ansible/ansible-modules-extras#1401</a></p>
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/KpaBap/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/KpaBap">@KpaBap</a> on 2016-09-18T23:05:31Z</p>

<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">ec2_eni</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 (devel fa5f8a7543) last updated 2016/09/18 02:10:05 (GMT -700)
  lib/ansible/modules/core: (detached HEAD 488f082761) last updated 2016/09/18 02:10:48 (GMT -700)
  lib/ansible/modules/extras: (detached HEAD 24da3602c6) last updated 2016/09/18 02:10:57 (GMT -700)
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/usr/share/ansible']"><pre class="notranslate"><code class="notranslate">ansible 2.2.0 (devel fa5f8a7543) last updated 2016/09/18 02:10:05 (GMT -700)
  lib/ansible/modules/core: (detached HEAD 488f082761) last updated 2016/09/18 02:10:48 (GMT -700)
  lib/ansible/modules/extras: (detached HEAD 24da3602c6) last updated 2016/09/18 02:10:57 (GMT -700)
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/usr/share/ansible']
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<p dir="auto">Default</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">N\A</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">I'm trying to create a new ENI in AWS with secondary private IPs.<br>
Instead of creating new ENIs, Ansible just fails because it seems to be finding an existing ENI and refusing to change it.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Create ENI for eth0 on Edge instances
  ec2_eni:
    state: present
    secondary_private_ip_address_count: 3
    subnet_id: subnet-72870d2a
    security_groups:
      - sg-5f4c6f27 "><pre class="notranslate"><code class="notranslate">- name: Create ENI for eth0 on Edge instances
  ec2_eni:
    state: present
    secondary_private_ip_address_count: 3
    subnet_id: subnet-72870d2a
    security_groups:
      - sg-5f4c6f27 
</code></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">A new ENI to be created with 3 secondary private IPs.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>

<p dir="auto">The module finds some existing ENI and just returns "changed":"false". This breaks creating ENIs completely.</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [Create ENI for eth0 on Edge instances] ***********************************
ok: [localhost] =&gt; {&quot;changed&quot;: false, &quot;interface&quot;: {&quot;attachment&quot;: {&quot;attach_time&quot;: &quot;2016-04-05T21:04:51.000Z&quot;, &quot;attachment_id&quot;: &quot;eni-attach-476e1abb&quot;, &quot;delete_on_termination&quot;: false, &quot;device_index&quot;: 1, &quot;instance_id&quot;: &quot;i-f3a7d668&quot;, &quot;status&quot;: &quot;attached&quot;}, &quot;description&quot;: &quot;&quot;, &quot;groups&quot;: {&quot;sg-5f4c6f27&quot;: &quot;GWAAS-SG-Iavor-Edge&quot;}, &quot;id&quot;: &quot;eni-df31ee8f&quot;, &quot;mac_address&quot;: &quot;0e:e6:a9:ff:d4:4b&quot;, &quot;owner_id&quot;: &quot;953738397088&quot;, &quot;private_ip_address&quot;: &quot;172.16.2.151&quot;, &quot;private_ip_addresses&quot;: [{&quot;primary_address&quot;: true, &quot;private_ip_address&quot;: &quot;172.16.2.151&quot;}, {&quot;primary_address&quot;: false, &quot;private_ip_address&quot;: &quot;172.16.2.230&quot;}, {&quot;primary_address&quot;: false, &quot;private_ip_address&quot;: &quot;172.16.2.61&quot;}, {&quot;primary_address&quot;: false, &quot;private_ip_address&quot;: &quot;172.16.2.62&quot;}], &quot;source_dest_check&quot;: true, &quot;status&quot;: &quot;in-use&quot;, &quot;subnet_id&quot;: &quot;subnet-72870d2a&quot;, &quot;vpc_id&quot;: &quot;vpc-617a6b05&quot;}}"><pre class="notranslate"><code class="notranslate">TASK [Create ENI for eth0 on Edge instances] ***********************************
ok: [localhost] =&gt; {"changed": false, "interface": {"attachment": {"attach_time": "2016-04-05T21:04:51.000Z", "attachment_id": "eni-attach-476e1abb", "delete_on_termination": false, "device_index": 1, "instance_id": "i-f3a7d668", "status": "attached"}, "description": "", "groups": {"sg-5f4c6f27": "GWAAS-SG-Iavor-Edge"}, "id": "eni-df31ee8f", "mac_address": "0e:e6:a9:ff:d4:4b", "owner_id": "953738397088", "private_ip_address": "172.16.2.151", "private_ip_addresses": [{"primary_address": true, "private_ip_address": "172.16.2.151"}, {"primary_address": false, "private_ip_address": "172.16.2.230"}, {"primary_address": false, "private_ip_address": "172.16.2.61"}, {"primary_address": false, "private_ip_address": "172.16.2.62"}], "source_dest_check": true, "status": "in-use", "subnet_id": "subnet-72870d2a", "vpc_id": "vpc-617a6b05"}}
</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="177683431" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-extras/issues/2956" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-extras/issues/2956/hovercard" href="https://github.com/ansible/ansible-modules-extras/issues/2956">ansible/ansible-modules-extras#2956</a></p>