Skip to content

Commit b6d65e4

Browse files
committed
add environement setup play-book
1 parent 8c27fa4 commit b6d65e4

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

environment_create.yml

+20-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
- name: Setup frontend instances on AWS Environment with nginx
2-
hosts: webservers
1+
- name: Create AWS Environment
2+
hosts: localhost
33
gather_facts: False
4+
vars_files:
5+
- vars/aws.yml
6+
- vars/aws_credentials.yml
47
tasks:
5-
- import_tasks: tasks/ec2_setup_frontend.yml
6-
- name: Setup backend instances on AWS Environment with nginx and spring boot microservice
7-
hosts: microservices
8-
gather_facts: False
9-
tasks:
10-
- import_tasks: tasks/ec2_setup_backend.yml
8+
- name: Get the current username
9+
local_action: command whoami
10+
register: username_on_the_host
11+
- import_tasks: tasks/ec2_create_keypair.yml
12+
- import_tasks: tasks/ec2_create_vpc.yml
13+
- import_tasks: tasks/ec2_create_securitygroups.yml
14+
- import_tasks: tasks/ec2_create_subnets.yml
15+
- import_tasks: tasks/ec2_create_internet_gateway.yml
16+
# - import_tasks: tasks/ec2_create_elasticip.yml
17+
- import_tasks: tasks/ec2_create_nat_gateway.yml
18+
- import_tasks: tasks/ec2_create_routes.yml
19+
- import_tasks: tasks/ec2_create_load_balancer.yml
20+
- import_tasks: tasks/ec2_create_instance_frontend.yml
21+
- import_tasks: tasks/ec2_create_instance_backend.yml
22+
- import_tasks: tasks/ec2_add-key-pair-and-public-key.yml

environment_setup.yml

-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
- name: Create AWS Environment
2-
hosts: localhost
3-
gather_facts: False
4-
vars_files:
5-
- vars/aws.yml
6-
- vars/aws_credentials.yml
7-
tasks:
8-
- name: Get the current username
9-
local_action: command whoami
10-
register: username_on_the_host
11-
- import_tasks: tasks/ec2_create_keypair.yml
12-
- import_tasks: tasks/ec2_create_vpc.yml
13-
- import_tasks: tasks/ec2_create_securitygroups.yml
14-
- import_tasks: tasks/ec2_create_subnets.yml
15-
- import_tasks: tasks/ec2_create_internet_gateway.yml
16-
# - import_tasks: tasks/ec2_create_elasticip.yml
17-
- import_tasks: tasks/ec2_create_nat_gateway.yml
18-
- import_tasks: tasks/ec2_create_routes.yml
19-
- import_tasks: tasks/ec2_create_load_balancer.yml
20-
- import_tasks: tasks/ec2_create_instance_frontend.yml
21-
- import_tasks: tasks/ec2_create_instance_backend.yml
22-
- import_tasks: tasks/ec2_add-key-pair-and-public-key.yml
231
- name: Setup frontend instances on AWS Environment with nginx
242
hosts: webservers
253
gather_facts: False

0 commit comments

Comments
 (0)