Skip to content

Commit 2ba7f2c

Browse files
author
Christopher M. Neill
committed
Initial commit.
1 parent c5251e2 commit 2ba7f2c

6 files changed

Lines changed: 81 additions & 0 deletions

File tree

ansible/group_vars/delta.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
env: "delta"
3+
region: "us-west-2"
4+
vpc_id: "vpc-864c6be3"

ansible/group_vars/sg_list.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: security_groups
2+
sg_api: API
3+
sg_bastion: Bastion
4+
sg_dock: Docks
5+
sg_hipache: Hipache
6+
sg_mongo: MongoDB
7+
sg_nat: NAT
8+
sg_navi: Navi
9+
sg_neo4j: Neo4J
10+
sg_rabbit: RabbitMQ
11+
sg_rds: RDS
12+
sg_redis: Redis
13+
sg_services: Services
14+
sg_userland: Userland Hipache
15+
sg_web: Web

ansible/local/hosts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[local]
2+
localhost
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- name: create AWS SG
2+
ec2_group:
3+
name: "{{ sg_name }}"
4+
description: "{{ env }} security policy for {{ descr }}"
5+
vpc_id: "{{ vpc_id }}"
6+
region: "{{ region }}"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
- name: example ec2 group
2+
ec2_group:
3+
name: example
4+
description: an example EC2 group
5+
vpc_id: 12345
6+
region: eu-west-1a
7+
aws_secret_key: SECRET
8+
aws_access_key: ACCESS
9+
rules:
10+
- proto: tcp
11+
from_port: 80
12+
to_port: 80
13+
cidr_ip: 0.0.0.0/0
14+
- proto: tcp
15+
from_port: 22
16+
to_port: 22
17+
cidr_ip: 10.0.0.0/8
18+
- proto: tcp
19+
from_port: 443
20+
to_port: 443
21+
group_id: amazon-elb/sg-87654321/amazon-elb-sg
22+
- proto: tcp
23+
from_port: 3306
24+
to_port: 3306
25+
group_id: 123412341234/sg-87654321/exact-name-of-sg
26+
- proto: udp
27+
from_port: 10050
28+
to_port: 10050
29+
cidr_ip: 10.0.0.0/8
30+
- proto: udp
31+
from_port: 10051
32+
to_port: 10051
33+
group_id: sg-12345678
34+
- proto: icmp
35+
from_port: 8 # icmp type, -1 = any type
36+
to_port: -1 # icmp subtype, -1 = any subtype
37+
cidr_ip: 10.0.0.0/8
38+
- proto: all
39+
# the containing group name may be specified here
40+
# group_name: example
41+
# rules_egress:
42+
# - proto: tcp
43+
# from_port: 80
44+
# to_port: 80
45+
# cidr_ip: 0.0.0.0/0
46+
# group_name: example-other
47+
# # description to use if example-other needs to be created
48+
# group_desc: other example EC2 group

ansible/sg_create.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
- hosts: all
3+
vars_files:
4+
- "group_vars/delta.yml"
5+
roles:
6+
- { role: create_sg }

0 commit comments

Comments
 (0)