aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/main.yml')
-rw-r--r--test/main.yml28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/main.yml b/test/main.yml
index bc9d27c..a4834be 100644
--- a/test/main.yml
+++ b/test/main.yml
@@ -117,18 +117,19 @@
117 - name: "{{ postgres_barman_directory }}" 117 - name: "{{ postgres_barman_directory }}"
118 description: 'Main database' 118 description: 'Main database'
119 primary_host: postgres_one 119 primary_host: postgres_one
120 primary_barman_password: "secret_cocktail" 120 postgres_barman_password: "secret_cocktail"
121 backup_method: rsync 121 backup_method: rsync
122 ansible_group: db-all 122 standby_hosts: "{{ groups['db-all'][1:] }}"
123 retention_policy: 'RECOVERY WINDOW OF 7 DAYS' 123 retention_policy: 'RECOVERY WINDOW OF 7 DAYS'
124 with_items: 124 with_items:
125 - postgres_barman 125 - postgres_barman
126 tags: provision_docker 126 tags: provision_docker
127 127
128- name: Test installing Barman role 128- name: Test installing Postgresql role
129 hosts: barman 129 hosts: primary:secondary
130 connection: docker 130 connection: docker
131 vars: {} 131 vars:
132 postgres_listen_addresses: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"
132 pre_tasks: &pre_tasks 133 pre_tasks: &pre_tasks
133 - name: "Build hosts file" 134 - name: "Build hosts file"
134 shell: 'echo "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }} {{inventory_hostname}}" >> /etc/hosts' 135 shell: 'echo "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }} {{inventory_hostname}}" >> /etc/hosts'
@@ -136,15 +137,6 @@
136 137
137 - debug: msg="Running on host {{inventory_hostname}} ({{ hostvars[inventory_hostname].ansible_default_ipv4.address }})" 138 - debug: msg="Running on host {{inventory_hostname}} ({{ hostvars[inventory_hostname].ansible_default_ipv4.address }})"
138 roles: 139 roles:
139 - { role: barman, tags: ['barman'] }
140
141- name: Test installing Postgresql role
142 hosts: primary:secondary
143 connection: docker
144 vars:
145 postgres_listen_addresses: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"
146 pre_tasks: *pre_tasks
147 roles:
148 - { role: ansible-postgresql-role, tags: ['postgres'] } 140 - { role: ansible-postgresql-role, tags: ['postgres'] }
149 tasks: 141 tasks:
150 - name: Start postgres cluster 142 - name: Start postgres cluster
@@ -157,6 +149,14 @@
157 command: psql --port=5432 --command='select NOW()' 149 command: psql --port=5432 --command='select NOW()'
158 150
159 151
152- name: Test installing Barman role
153 hosts: barman
154 connection: docker
155 vars: {}
156 pre_tasks: *pre_tasks
157 roles:
158 - { role: barman, tags: ['barman'] }
159
160- name: Test running Postgresql role when database is started 160- name: Test running Postgresql role when database is started
161 connection: docker 161 connection: docker
162 hosts: primary:secondary 162 hosts: primary:secondary