More ansible-lint fixes
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
{{ matrix_postgres_docker_image_to_use }}
|
||||
-c
|
||||
'psql -h {{ matrix_postgres_connection_hostname }} --file=/matrix-postgres-init-additional-db-user-and-role.sql'
|
||||
changed_when: true
|
||||
|
||||
- name: Delete additional database initialization SQL file for {{ additional_db.name }}
|
||||
ansible.builtin.file:
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
- name: Determine existing Postgres version (make sense of PG_VERSION file)
|
||||
ansible.builtin.set_fact:
|
||||
matrix_postgres_detected_version: "{{ result_pg_version['content']|b64decode|replace('\n', '') }}"
|
||||
matrix_postgres_detected_version: "{{ result_pg_version['content'] | b64decode | replace('\n', '') }}"
|
||||
when: matrix_postgres_detected_existing | bool
|
||||
|
||||
- name: Determine corresponding Docker image to detected version (assume default of latest)
|
||||
|
@ -131,6 +131,8 @@
|
||||
{{ matrix_postgres_pgloader_docker_image }}
|
||||
-c
|
||||
'pgloader {{ matrix_postgres_db_migration_request.pgloader_options | default([]) | join(' ') }} /in.db {{ matrix_postgres_db_migration_request.dst }}'
|
||||
register: matrix_postgres_migrate_db_to_postgres_import_result
|
||||
changed_when: matrix_postgres_migrate_db_to_postgres_import_result.rc == 0
|
||||
|
||||
- block:
|
||||
# We can't use `{{ role_path }}` here, neither with `import_tasks`, nor with `include_tasks`,
|
||||
@ -152,12 +154,16 @@
|
||||
{{ matrix_postgres_docker_image_to_use }}
|
||||
psql --host=matrix-postgres --dbname={{ matrix_postgres_db_migration_request.additional_psql_statements_db_name }} --command='{{ item }}'
|
||||
with_items: "{{ matrix_postgres_db_migration_request.additional_psql_statements_list }}"
|
||||
register: matrix_postgres_migrate_db_to_postgres_additional_queries_result
|
||||
changed_when: matrix_postgres_migrate_db_to_postgres_additional_queries_result.rc == 0
|
||||
|
||||
when: "matrix_postgres_db_migration_request.additional_psql_statements_list | default([])|length > 0"
|
||||
|
||||
- name: Archive {{ matrix_postgres_db_migration_request.engine_old }} database ({{ matrix_postgres_db_migration_request.src }} -> {{ matrix_postgres_db_migration_request.src }}.backup)
|
||||
ansible.builtin.command:
|
||||
cmd: "mv {{ matrix_postgres_db_migration_request.src }} {{ matrix_postgres_db_migration_request.src }}.backup"
|
||||
register: matrix_postgres_migrate_db_to_postgres_move_result
|
||||
changed_when: matrix_postgres_migrate_db_to_postgres_move_result.rc == 0
|
||||
|
||||
- name: Inject result
|
||||
ansible.builtin.set_fact:
|
||||
|
Reference in New Issue
Block a user