{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2365","repository_url":"https://api.github.com/repos/ansible/ansible-modules-extras","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2365/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2365/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2365/events","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2365","id":158225975,"number":2365,"title":"Fix the AMI creation/modification logic thus making it idempotent","user":{"login":"filipenf","id":1359293,"avatar_url":"https://avatars.githubusercontent.com/u/1359293?v=3","gravatar_id":"","url":"https://api.github.com/users/filipenf","html_url":"https://github.com/filipenf","followers_url":"https://api.github.com/users/filipenf/followers","following_url":"https://api.github.com/users/filipenf/following{/other_user}","gists_url":"https://api.github.com/users/filipenf/gists{/gist_id}","starred_url":"https://api.github.com/users/filipenf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipenf/subscriptions","organizations_url":"https://api.github.com/users/filipenf/orgs","repos_url":"https://api.github.com/users/filipenf/repos","events_url":"https://api.github.com/users/filipenf/events{/privacy}","received_events_url":"https://api.github.com/users/filipenf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/bugfix_pull_request","name":"bugfix_pull_request","color":"ded270"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/cloud","name":"cloud","color":"c7def8"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/community_review","name":"community_review","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-02T19:56:41Z","updated_at":"2016-06-14T11:27:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/2365","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2365","diff_url":"https://github.com/ansible/ansible-modules-extras/pull/2365.diff","patch_url":"https://github.com/ansible/ansible-modules-extras/pull/2365.patch"},"body":"##### ISSUE TYPE\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\n\r\nec2_eni\r\n\r\n##### ANSIBLE VERSION\r\n```\r\n➜  ansible --version\r\nansible 2.2.0 (devel f0023610e8) last updated 2016/06/02 16:41:50 (GMT -200)\r\n  lib/ansible/modules/core: (detached HEAD ca4365b644) last updated 2016/06/02 16:42:04 (GMT -200)\r\n  lib/ansible/modules/extras: (fix-ec2_eni 9d0ca87482) last updated 2016/06/02 16:39:24 (GMT -200)\r\n  config file = ...\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\n\r\nFixes https://github.com/ansible/ansible-modules-extras/issues/2084 \r\n\r\n##### Commands tested:\r\n\r\n* ENI Creation:\r\n `ansible -i localhost, -c local -m ec2_eni -a 'private_ip_address=10.137.8.7 subnet_id=subnet-??? state=present region=eu-west-1 ' localhost`\r\n* Modifying description: \r\n`ansible -i localhost, -c local -m ec2_eni -a 'private_ip_address=10.137.8.7 subnet_id=subnet-??? description=bla state=present region=eu-west-1 ' localhost`\r\n* Modifying security groups: `ansible -i localhost, -c local -m ec2_eni -a 'private_ip_address=10.137.8.7 subnet_id=subnet-??? state=present region=eu-west-1 security_groups=sg-8708dde0 ' localhost `\r\n* Modifying delete_on_termination: `ansible -i localhost, -c local -m ec2_eni -a 'private_ip_address=10.137.8.7 subnet_id=subnet-??? state=present region=eu-west-1 delete_on_termination=yes ' localhost \r\n* Detaching: `ansible -i localhost, -c local -m ec2_eni -a 'eni_id=eni-1c216256 state=detached region=eu-west-1`\r\n* Deleting: `ansible -i localhost, -c local -m ec2_eni -a 'eni_id=eni-1c216256 state=absent region=eu-west-1' localhost`\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/225853404","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2365#issuecomment-225853404","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2365","id":225853404,"user":{"login":"wimnat","id":7425606,"avatar_url":"https://avatars.githubusercontent.com/u/7425606?v=3","gravatar_id":"","url":"https://api.github.com/users/wimnat","html_url":"https://github.com/wimnat","followers_url":"https://api.github.com/users/wimnat/followers","following_url":"https://api.github.com/users/wimnat/following{/other_user}","gists_url":"https://api.github.com/users/wimnat/gists{/gist_id}","starred_url":"https://api.github.com/users/wimnat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wimnat/subscriptions","organizations_url":"https://api.github.com/users/wimnat/orgs","repos_url":"https://api.github.com/users/wimnat/repos","events_url":"https://api.github.com/users/wimnat/events{/privacy}","received_events_url":"https://api.github.com/users/wimnat/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T11:27:17Z","updated_at":"2016-06-14T11:27:17Z","body":"@filipenf i think the best thing to do here is to add a new parameter 'attached' which can either be true or false and use this to determine what state the eni should take.  This keeps state clean and we don't have instance_id parameter dictating whether it should be attached or not.  needs_review"}}
{"actor":{"display_login":"wimnat"}}