Feature/dev 1110 Extend backup process to support multiple db servers per stage
parent
b5034abf5b
commit
6862f58b78
@ -1,13 +1,3 @@
|
||||
---
|
||||
shared_service_pg_master_ip: "{{ stage_server_infos
|
||||
| selectattr('name', 'match', stage + '-postgres-01' )
|
||||
| map(attribute='private_ip')
|
||||
| list
|
||||
| first
|
||||
| default('-') }}"
|
||||
shared_service_pg_slave_ip: "{{ stage_server_infos
|
||||
| selectattr('name', 'match', stage + '-postgres-02' )
|
||||
| map(attribute='private_ip')
|
||||
| list
|
||||
| first
|
||||
| default('-') }}"
|
||||
shared_service_postgres_primary: "{{ stage }}-postgres-01"
|
||||
shared_service_postgres_secondary: "{{ stage }}-postgres-02"
|
||||
|
||||
@ -1,13 +1,3 @@
|
||||
---
|
||||
shared_service_pg_master_ip: "{{ stage_server_infos
|
||||
| selectattr('name', 'match', stage + '-postgres02-01' )
|
||||
| map(attribute='private_ip')
|
||||
| list
|
||||
| first
|
||||
| default('-') }}"
|
||||
shared_service_pg_slave_ip: "{{ stage_server_infos
|
||||
| selectattr('name', 'match', stage + '-postgres02-02' )
|
||||
| map(attribute='private_ip')
|
||||
| list
|
||||
| first
|
||||
| default('-') }}"
|
||||
shared_service_postgres_primary: "{{ stage }}-postgres02-01"
|
||||
shared_service_postgres_secondary: "{{ stage }}-postgres02-02"
|
||||
|
||||
Binary file not shown.
@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: "Triggering restore" # noqa command-instead-of-shell no-changed-when
|
||||
become: true
|
||||
shell: "/root/restore.sh {{ stage }} {{ database_server }}"
|
||||
|
||||
- name: "Check for test data on mariadb"
|
||||
block:
|
||||
- name: "Querying mariadb ..."
|
||||
become: true
|
||||
become_user: root
|
||||
community.mysql.mysql_query:
|
||||
login_unix_socket: /run/mysqld/mysqld.sock
|
||||
login_db: dummytestdb
|
||||
query: SELECT movie FROM movie_quotes WHERE quote = %s
|
||||
positional_args:
|
||||
- "Shall we play"
|
||||
register: query_output
|
||||
|
||||
- name: "Compare query result with given parameters ..."
|
||||
assert:
|
||||
that:
|
||||
- 'query_output.query_result | first | selectattr("movie","match","wargames") | length == 1'
|
||||
|
||||
when:
|
||||
- database_engine == 'maria'
|
||||
@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: "Triggering restore" # noqa command-instead-of-shell no-changed-when
|
||||
become: true
|
||||
shell: "/root/restore.sh {{ stage }} {{ database_server }}"
|
||||
|
||||
- name: "Check for test data on postgres"
|
||||
block:
|
||||
- name: "Querying postgres ..."
|
||||
become: true
|
||||
become_user: postgres
|
||||
community.postgresql.postgresql_query:
|
||||
db: dummytestdb
|
||||
query: SELECT movie FROM movie_quotes WHERE quote = %(quote_val)s
|
||||
named_args:
|
||||
quote_val: "Shall we play"
|
||||
register: query_output
|
||||
|
||||
- name: "Compare query result with given parameters ..."
|
||||
assert:
|
||||
that:
|
||||
- 'query_output.query_all_results | first | selectattr("movie","match","wargames") | length == 1'
|
||||
|
||||
when:
|
||||
- database_engine == 'postgres'
|
||||
Loading…
Reference in New Issue