-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_instance.yaml
55 lines (50 loc) · 1.16 KB
/
setup_instance.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env ansible-playbook
- hosts: tag_Name_BlogApp
tasks: []
- hosts: tag_Name_AdminApp
tasks: []
- name: Configure DockerHosts
hosts:
- tag_Type_DockerHost
sudo: true
roles:
- docker-host
- name: Configure Redis
hosts:
- tag_Name_Redis
sudo: true
roles:
- redis-host
- name: Configure Nodejs
hosts:
- tag_Name_AdminApp
- tag_Name_BlogApp
sudo: true
roles:
- nodejs-host
- name: Configure Nginx
hosts:
- tag_Name_Proxy
sudo: true
roles:
- role: nginx-host
nginx_sites:
- server:
name: admin
listen: 80
server_name: admin.domain.com
location1:
name: "/"
proxy_pass: "http://{{ hostvars[groups['tag_Name_AdminApp'][0]]['ec2_private_ip_address'] }}:8080"
- server:
name: blog
listen: 80
server_name: blog.domain.com
location1:
name: "/"
proxy_pass: "http://{{ hostvars[groups['tag_Name_BlogApp'][0]]['ec2_private_ip_address'] }}:8080"
nginx_enabled_sites:
- admin
- blog
nginx_disabled_sites:
- default