forked from yankurniawan/ansible-for-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsg_delete.yml
37 lines (37 loc) · 1.03 KB
/
sg_delete.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- hosts: localhost
connection: local
gather_facts: no
vars_files:
- staging_vpc_info
vars:
#your region
region: ap-southeast-2
#prefix for naming
prefix: staging
vpc_id: "{{ staging_vpc }}"
tasks:
- name: delete {{ prefix }}_sg_web
local_action:
module: ec2_group
region: "{{ region }}"
vpc_id: "{{ vpc_id }}"
name: "{{ prefix }}_sg_web"
description: security group for webservers
state: absent
- name: delete {{ prefix }}_sg_database
local_action:
module: ec2_group
region: "{{ region }}"
vpc_id: "{{ vpc_id }}"
name: "{{ prefix }}_sg_database"
description: security group for databases
state: absent
- name: delete {{ prefix }}_sg_nat
local_action:
module: ec2_group
region: "{{ region }}"
vpc_id: "{{ vpc_id }}"
name: "{{ prefix }}_sg_nat"
description: security group for nat
state: absent