aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorThéophile Helleboid - chtitux <chtitux@gmail.com>2020-05-12 21:32:14 +0400
committerGitHub <noreply@github.com>2020-05-12 21:32:14 +0400
commitebe451adda84672f9872187164df279dbfed7a35 (patch)
tree4f5ce44e988bebf91f1b21fe7f9dc0f49843624f /test
parentb9038ad7484a472f1e745906fb0d26530061b58d (diff)
parent61b4552ae3514a7ae94591a85c4708ac0d7db078 (diff)
downloadansible-postgresql-role-ebe451adda84672f9872187164df279dbfed7a35.tar.gz
ansible-postgresql-role-ebe451adda84672f9872187164df279dbfed7a35.tar.zst
ansible-postgresql-role-ebe451adda84672f9872187164df279dbfed7a35.zip
Merge pull request #11 from paulrbr-fl/postgresql-12
core: Add compatibility with PG 12 major version
Diffstat (limited to 'test')
-rw-r--r--test/main.yml32
-rw-r--r--test/requirements.txt3
-rw-r--r--test/requirements.yml2
3 files changed, 20 insertions, 17 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'] }
diff --git a/test/requirements.txt b/test/requirements.txt
index d2cbb1a..3dfa5a6 100644
--- a/test/requirements.txt
+++ b/test/requirements.txt
@@ -1 +1,2 @@
1docker-py 1ansible
2docker
diff --git a/test/requirements.yml b/test/requirements.yml
index f9d7099..7c41335 100644
--- a/test/requirements.yml
+++ b/test/requirements.yml
@@ -1,6 +1,6 @@
1- src: chrismeyersfsu.provision_docker 1- src: chrismeyersfsu.provision_docker
2 name: provision_docker 2 name: provision_docker
3 version: 7a6243dfcf69f9d262877eca487bc14b62ba6960 3 version: d68ce0aa486eff7669011ee2f9eaf68b95184ce1
4- src: trainline-eu.ansible_barman_role 4- src: trainline-eu.ansible_barman_role
5 name: barman 5 name: barman
6 version: 1.1.0 6 version: 1.1.0