Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Brent Langston
Create an egress_rules: list that is empty. On May 15, 2015 2:19 PM, "Rahul Mehrotra" wrote: > Thanks Brent that does explain a good detail about how security groups are > handled by Ansible. > I would still appreciate if you can answer this question. > > I am creating a security group using > >

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Rahul Mehrotra
Thanks Brent that does explain a good detail about how security groups are handled by Ansible. I would still appreciate if you can answer this question. I am creating a security group using - name: Create HTTP Security Group local_action: module: ec2_group region: "{{ region }}" vpc

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Brent Langston
the security group module will just make your list of rules look like whatever you have currently defined in yml. If you remove a rule from the list, and run the task again, the rule will be removed from the security group at aws. This hold true for both ingress and egress. In other words, for thi

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Rahul Mehrotra
Hi, Can you please provide an example. I am specifically interested in removing egress rules allowing everything automatically added by AWS when security groups are created. Thank you -

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Brent Langston
remove the rule from the list. rules: [] Brent On Fri, May 15, 2015 at 1:32 PM, Rahul Mehrotra wrote: > > I have an Ansible script to create EC2 security group. It looks like this > > - name: Create HTTP Security Group > local_action: > module: ec2_group > region: "

[ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Rahul Mehrotra
I have an Ansible script to create EC2 security group. It looks like this - name: Create HTTP Security Group local_action: module: ec2_group region: "{{ region }}" vpc_id: "{{ vpc }}" name: sg_http description: Security group for HTTP access rules: - proto: tcp