Commit fc49dfc2fc5d7c5c5cdb9757c2452515fb39f070

Authored by Ricardo Gonçalves
1 parent aec39ba7c0
Exists in master

changes

hosts
... ... @@ -18,8 +18,8 @@
18 18 # Ex 2: A collection of hosts belonging to the 'webservers' group
19 19  
20 20 [webservers]
21   -10.10.10.57 ansible_python_interpreter: {{path_to_python}}
22   -10.10.10.47 ansible_python_interpreter: {{path_to_python}}
  21 +10.10.10.57 ansible_python_interpreter={{path_to_python}}
  22 +10.10.10.47 ansible_python_interpreter={{path_to_python}}
23 23  
24 24 # If you have multiple hosts following a pattern you can specify
25 25 # them like this:
... ... @@ -29,7 +29,7 @@
29 29 # Ex 3: A collection of database servers in the 'dbservers' group
30 30  
31 31 [dbservers]
32   -10.10.10.74 ansible_python_interpreter: {{path_to_python}}
  32 +10.10.10.74 ansible_python_interpreter={{path_to_python}}
33 33  
34 34 # Here's another example of host ranges, this time there are no
35 35 # leading 0s:
... ... @@ -37,7 +37,7 @@
37 37 #db-[99:101]-node.example.com
38 38  
39 39 [proxyserver]
40   -10.10.10.33:22 ansible_ssh_user=ubuntu ansible_python_interpreter: {{path_to_python}}
  40 +10.10.10.33:22 ansible_ssh_user=ubuntu ansible_python_interpreter={{path_to_python}}
41 41  
42 42 [jenkinserver]
43 43 193.136.46.156:30022 ansible_ssh_user=ubuntu
... ...
roles/docker/tasks/main.yml
... ... @@ -7,12 +7,6 @@
7 7  
8 8 - name: Install list of packages
9 9 apt:
10   - name: "{{ item }}"
  10 + name: ['apt-transport-https','ca-certificates','curl','software-properties-common','docker-ce']
11 11 state: present
12 12 update_cache: yes
13   - with_items:
14   - - apt-transport-https
15   - - ca-certificates
16   - - curl
17   - - software-properties-common
18   - - docker-ce
... ...
roles/proxyserver/tasks/main.yml
... ... @@ -10,8 +10,6 @@
10 10 dest: "{{proxy_dir}}/"
11 11 clone: yes
12 12 force: yes
13   - when:
14   - - var
15 13  
16 14 - name: Installing docker dependencies
17 15 pip:
... ... @@ -19,22 +17,18 @@
19 17 state: present
20 18 with_items:
21 19 - docker-compose
22   - when:
23   - - var
24 20  
25 21 - name: Building haproxy config to {{proxy_dir}}
26 22 win_template:
27 23 src: haproxy.cfg
28 24 dest: "{{proxy_dir}}/"
29   - when:
30   - - var
  25 +
31 26  
32 27 - name: Building docker-compose file to {{proxy_dir}}
33 28 win_template:
34 29 src: docker-compose.yml
35 30 dest: "{{proxy_dir}}/"
36   - when:
37   - - var
  31 +
38 32  
39 33 - name: Running containers with docker-compose
40 34 docker_service:
... ... @@ -42,8 +36,6 @@
42 36 build: yes
43 37 nocache: yes
44 38 state: "{{'present' if var else 'absent'}}"
45   - when:
46   - - var
47 39  
48 40 # - name: "Running containers"
49 41 # docker_service:
... ...
vars/vars.yaml
... ... @@ -10,7 +10,8 @@ proxy_dir: /opt/proxyserver/
10 10 webs_dir: /opt/webserver/
11 11 db_dir: /opt/dbserver/
12 12  
13   -path_to_python: /usr/bin/python3.6
  13 +#diretoria para o python-> para estabelecer ligação com os servidores
  14 +path_to_python: /usr/bin/python2.7
14 15  
15 16 #portos para a aplicação
16 17 proxy_port: 8002
... ... @@ -21,4 +22,7 @@ browser_port: 30098
21 22 #máquinas que correm a app
22 23 webserver1: 10.10.10.57
23 24 webserver2: 10.10.10.47
24   -db_server: 10.10.10.74
25 25 \ No newline at end of file
  26 +db_server: 10.10.10.74
  27 +
  28 +#variavel que permite correr os containers
  29 +var: true
26 30 \ No newline at end of file
... ...