<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kuza55/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kuza55">@kuza55</a> on 2016-06-30T17:33:27Z</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 module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">$ ansible --version<br>
ansible 2.1.0.0<br>
config file = /etc/ansible/ansible.cfg<br>
configured module search path = Default w/o overrides</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Ubuntu on Windows 10</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Changing the group_id value for a running instance has no effect on it's security groups</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Run playbook that creates ec2 instance<br>
Add extra group_id to playbook<br>
Run playbook again</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">ec2 instance is in both security groups</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">security group of instance is not changed.</p>
<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="163221719" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/4083" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/4083/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/4083">ansible/ansible-modules-core#4083</a></p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Feature Idea</p>
<h5 dir="auto">Component Name:</h5>
<p dir="auto">ec2 module</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.8.1</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">I did not find a way to change EC2 Security Groups on an existing instance. It is possible to define the groups when creating a new instance with the "ec2" module, but nto to alter, add or remove groups on an existing instance.</p>
<p dir="auto">Rationale: I create an instance with a limited set of security groups, so that the software cannot connect to the server yet during provisioning. Then I provision the host, and at the end I want to add a security group so that the host can start connecting to the server and process work.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">Being able to:</p>
<ul dir="auto">
<li>Add security groups to an existing EC2 instance</li>
<li>Remove security groups from an existing EC2 instance</li>
<li>Overwrite the security groups on an existing EC2 instance</li>
</ul>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">N/A</p>