diff options
Diffstat (limited to 'test/main.yml')
-rw-r--r-- | test/main.yml | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/test/main.yml b/test/main.yml index a4834be..6a819d8 100644 --- a/test/main.yml +++ b/test/main.yml | |||
@@ -2,8 +2,7 @@ | |||
2 | - name: Bring up docker containers | 2 | - name: Bring up docker containers |
3 | hosts: localhost | 3 | hosts: localhost |
4 | vars: &common_vars | 4 | vars: &common_vars |
5 | postgres_version: 11 | 5 | postgres_barman_directory: "test-postgres-{{ postgres_version }}" |
6 | postgres_barman_directory: 'test-postgres-11' | ||
7 | postgres_barman_server: postgres_barman | 6 | postgres_barman_server: postgres_barman |
8 | barman_rsync_password: "secret_rsync" | 7 | barman_rsync_password: "secret_rsync" |
9 | barman_rsync_allowed_hosts: 172.17.0.0/24 | 8 | barman_rsync_allowed_hosts: 172.17.0.0/24 |
@@ -15,25 +14,28 @@ | |||
15 | range: 172.17.0.0/24 | 14 | range: 172.17.0.0/24 |
16 | inventory: | 15 | inventory: |
17 | - name: "{{ postgres_barman_server }}" | 16 | - name: "{{ postgres_barman_server }}" |
18 | image: "python:3.7-stretch" | 17 | image: "python:3.7-{{ debian_release }}" |
19 | - name: postgres_one | 18 | - name: postgres_one |
20 | image: "python:3.7-stretch" | 19 | image: "python:3.7-{{ debian_release }}" |
21 | links: | 20 | links: |
22 | - "{{ postgres_barman_server }}" | 21 | - "{{ postgres_barman_server }}" |
23 | - name: postgres_two | 22 | - name: postgres_two |
24 | image: "python:3.7-stretch" | 23 | image: "python:3.7-{{ debian_release }}" |
25 | links: | 24 | links: |
26 | - "{{ postgres_barman_server }}" | 25 | - "{{ postgres_barman_server }}" |
27 | - postgres_one | 26 | - postgres_one |
28 | - name: postgres_three | 27 | - name: postgres_three |
29 | image: "python:3.7-stretch" | 28 | image: "python:3.7-{{ debian_release }}" |
30 | links: | 29 | links: |
31 | - "{{ postgres_barman_server }}" | 30 | - "{{ postgres_barman_server }}" |
32 | - postgres_one | 31 | - postgres_one |
33 | roles: | 32 | roles: |
34 | - role: provision_docker | 33 | - role: provision_docker |
35 | provision_docker_inventory: "{{inventory}}" | 34 | vars: |
36 | provision_docker_use_docker_connection: true | 35 | provision_docker_inventory: "{{inventory}}" |
36 | provision_docker_use_docker_connection: true | ||
37 | ansible_connection: local | ||
38 | ansible_python_interpreter: "{{ansible_playbook_python}}" | ||
37 | tasks: | 39 | tasks: |
38 | - name: Group primary | 40 | - name: Group primary |
39 | add_host: | 41 | add_host: |
@@ -63,7 +65,7 @@ | |||
63 | extensions: | 65 | extensions: |
64 | - description: PostGis | 66 | - description: PostGis |
65 | apt_deps: | 67 | apt_deps: |
66 | - "postgresql-{{ postgres_version }}-postgis" | 68 | - "postgresql-{{ postgres_version }}-postgis-3" |
67 | names: | 69 | names: |
68 | - postgis | 70 | - postgis |
69 | - postgis_topology | 71 | - postgis_topology |
@@ -129,13 +131,13 @@ | |||
129 | hosts: primary:secondary | 131 | hosts: primary:secondary |
130 | connection: docker | 132 | connection: docker |
131 | vars: | 133 | vars: |
132 | postgres_listen_addresses: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}" | 134 | postgres_listen_addresses: ["{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"] |
133 | pre_tasks: &pre_tasks | 135 | pre_tasks: &pre_tasks |
134 | - name: "Build hosts file" | 136 | - name: "Build hosts file" |
135 | shell: 'echo "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }} {{inventory_hostname}}" >> /etc/hosts' | 137 | shell: 'echo "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }} {{inventory_hostname}}" >> /etc/hosts' |
136 | when: hostvars[inventory_hostname].ansible_default_ipv4.address is defined | 138 | when: hostvars[inventory_hostname].ansible_default_ipv4.address is defined |
137 | 139 | ||
138 | - debug: msg="Running on host {{inventory_hostname}} ({{ hostvars[inventory_hostname].ansible_default_ipv4.address }})" | 140 | - debug: msg="Running on host {{inventory_hostname}} ({{ hostvars[inventory_hostname].ansible_default_ipv4.address }})" |
139 | roles: | 141 | roles: |
140 | - { role: ansible-postgresql-role, tags: ['postgres'] } | 142 | - { role: ansible-postgresql-role, tags: ['postgres'] } |
141 | tasks: | 143 | tasks: |
@@ -161,7 +163,7 @@ | |||
161 | connection: docker | 163 | connection: docker |
162 | hosts: primary:secondary | 164 | hosts: primary:secondary |
163 | vars: | 165 | vars: |
164 | postgres_listen_addresses: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}" | 166 | postgres_listen_addresses: ["{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"] |
165 | pre_tasks: *pre_tasks | 167 | pre_tasks: *pre_tasks |
166 | roles: | 168 | roles: |
167 | - { role: ansible-postgresql-role, tags: ['postgres'] } | 169 | - { role: ansible-postgresql-role, tags: ['postgres'] } |