Commit 6bbaa7e199639efd1f93128a2d6eb706e9f7da44

Authored by Ricardo Gon├žalves
1 parent 9829e6fe0c
Exists in master

changes

playbook.yml
... ... @@ -6,8 +6,6 @@
6 6 - proxyserver
7 7 vars_files:
8 8 - vars/vars.yaml
9   - when:
10   - - proxyflag
11 9  
12 10 - hosts: webservers
13 11 become: true
... ... @@ -16,8 +14,6 @@
16 14 - webserver
17 15 vars_files:
18 16 - vars/vars.yaml
19   - when:
20   - - webflag
21 17  
22 18 - hosts: dbservers
23 19 become: true
... ... @@ -25,6 +21,4 @@
25 21 - docker-git-pip
26 22 - dbserver
27 23 vars_files:
28   - - vars/vars.yaml
29   - when:
30   - - dbflag
31 24 \ No newline at end of file
  25 + - vars/vars.yaml
32 26 \ No newline at end of file
... ...
roles/dbserver/tasks/main.yml
... ... @@ -5,18 +5,20 @@
5 5 clone: yes
6 6 force: yes
7 7 when:
8   - - var
  8 + - dbflag
9 9  
10 10 - name: Building docker-compose file to {{db_dir}}
11 11 win_template:
12 12 src: docker-compose.yml
13 13 dest: "{{db_dir}}/"
14 14 when:
15   - - var
  15 + - dbflag
16 16  
17 17 - name: Running containers with docker-compose
18 18 docker_service:
19 19 project_src: "{{db_dir}}"
20 20 build: yes
21 21 nocache: yes
22   - state: "{{'present' if var else 'absent'}}"
23 22 \ No newline at end of file
  23 + state: "{{'present' if var else 'absent'}}"
  24 + when:
  25 + - dbflag
24 26 \ No newline at end of file
... ...
roles/proxyserver/tasks/main.yml
... ... @@ -5,21 +5,21 @@
5 5 clone: yes
6 6 force: yes
7 7 when:
8   - - var
  8 + - proxyflag
9 9  
10 10 - name: Building haproxy config to {{proxy_dir}}
11 11 win_template:
12 12 src: haproxy.cfg
13 13 dest: "{{proxy_dir}}/"
14 14 when:
15   - - var
  15 + - proxyflag
16 16  
17 17 - name: Building docker-compose file to {{proxy_dir}}
18 18 win_template:
19 19 src: docker-compose.yml
20 20 dest: "{{proxy_dir}}/"
21 21 when:
22   - - var
  22 + - proxyflag
23 23  
24 24 - name: Running containers with docker-compose
25 25 docker_service:
... ... @@ -27,6 +27,8 @@
27 27 build: yes
28 28 nocache: yes
29 29 state: "{{'present' if var else 'absent'}}"
  30 + when:
  31 + - proxyflag
30 32  
31 33 # - name: "Running containers"
32 34 # docker_service:
... ...
roles/webserver/tasks/main.yml
... ... @@ -5,32 +5,34 @@
5 5 clone: yes
6 6 force: yes
7 7 when:
8   - - var
  8 + - webflag
9 9  
10 10 - name: Building nginx config to {{webs_dir}}nginx_cont/
11 11 win_template:
12 12 src: nginx.conf
13 13 dest: "{{webs_dir}}nginx_cont/"
14 14 when:
15   - - var
  15 + - webflag
16 16  
17 17 - name: Building app settings to {{webs_dir}}appdjango_cont/
18 18 win_template:
19 19 src: settings.py
20 20 dest: "{{webs_dir}}appdjango_cont/"
21 21 when:
22   - - var
  22 + - webflag
23 23  
24 24 - name: Building docker-compose file to {{webs_dir}}
25 25 win_template:
26 26 src: docker-compose.yml
27 27 dest: "{{webs_dir}}/"
28 28 when:
29   - - var
  29 + - webflag
30 30  
31 31 - name: Running containers with docker-compose
32 32 docker_service:
33 33 project_src: "{{webs_dir}}"
34 34 build: yes
35 35 nocache: yes
36   - state: "{{'present' if var else 'absent'}}"
37 36 \ No newline at end of file
  37 + state: "{{'present' if var else 'absent'}}"
  38 + when:
  39 + - webflag
38 40 \ No newline at end of file
... ...