mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2025-10-19 22:53:23 +00:00
More ansible-lint fixes
This commit is contained in:
@@ -3,35 +3,35 @@
|
||||
- name: Set default postgres_dump_dir, if not provided
|
||||
ansible.builtin.set_fact:
|
||||
postgres_dump_dir: "/tmp"
|
||||
when: "postgres_dump_dir|default('') == ''"
|
||||
when: "postgres_dump_dir | default('') == ''"
|
||||
|
||||
- name: Set postgres_dump_name, if not provided
|
||||
ansible.builtin.set_fact:
|
||||
postgres_dump_name: "matrix-postgres-dump.sql.gz"
|
||||
when: "postgres_dump_name|default('') == ''"
|
||||
when: "postgres_dump_name | default('') == ''"
|
||||
|
||||
- name: Set postgres_auto_upgrade_backup_data_path, if not provided
|
||||
ansible.builtin.set_fact:
|
||||
postgres_auto_upgrade_backup_data_path: "{{ matrix_postgres_data_path }}-auto-upgrade-backup"
|
||||
when: "postgres_auto_upgrade_backup_data_path|default('') == ''"
|
||||
when: "postgres_auto_upgrade_backup_data_path | default('') == ''"
|
||||
|
||||
- name: Set postgres_start_wait_time, if not provided
|
||||
ansible.builtin.set_fact:
|
||||
postgres_start_wait_time: 15
|
||||
when: "postgres_start_wait_time|default('') == ''"
|
||||
when: "postgres_start_wait_time | default('') == ''"
|
||||
|
||||
- name: Set postgres_force_upgrade, if not provided
|
||||
ansible.builtin.set_fact:
|
||||
postgres_force_upgrade: false
|
||||
when: "postgres_force_upgrade|default('') == ''"
|
||||
when: "postgres_force_upgrade | default('') == ''"
|
||||
|
||||
- name: Fail, if trying to upgrade external Postgres database
|
||||
ansible.builtin.fail:
|
||||
msg: "Your configuration indicates that you're not using Postgres from this role. There is nothing to upgrade."
|
||||
when: "not matrix_postgres_enabled|bool"
|
||||
when: "not matrix_postgres_enabled | bool"
|
||||
|
||||
- name: Check Postgres auto-upgrade backup data directory
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ postgres_auto_upgrade_backup_data_path }}"
|
||||
register: result_auto_upgrade_path
|
||||
|
||||
@@ -40,12 +40,12 @@
|
||||
msg: "Detected that a left-over {{ postgres_auto_upgrade_backup_data_path }} exists. You should rename it to {{ matrix_postgres_data_path }} if the previous upgrade went wrong, or delete it if it went well."
|
||||
when: "result_auto_upgrade_path.stat.exists"
|
||||
|
||||
- import_tasks: tasks/util/detect_existing_postgres_version.yml
|
||||
- ansible.builtin.import_tasks: tasks/util/detect_existing_postgres_version.yml
|
||||
|
||||
- name: Abort, if no existing Postgres version detected
|
||||
ansible.builtin.fail:
|
||||
msg: "Could not find existing Postgres installation"
|
||||
when: "not matrix_postgres_detected_existing|bool"
|
||||
when: "not matrix_postgres_detected_existing | bool"
|
||||
|
||||
- name: Abort, if already at latest Postgres version
|
||||
ansible.builtin.fail:
|
||||
@@ -67,7 +67,7 @@
|
||||
daemon_reload: true
|
||||
|
||||
- name: Wait a bit, so that Postgres can start
|
||||
wait_for:
|
||||
ansible.builtin.wait_for:
|
||||
timeout: "{{ postgres_start_wait_time }}"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
@@ -102,7 +102,7 @@
|
||||
- ansible.builtin.debug:
|
||||
msg: "NOTE: Your Postgres data directory has been moved from `{{ matrix_postgres_data_path }}` to `{{ postgres_auto_upgrade_backup_data_path }}`. In the event of failure, you can move it back and run the playbook with --tags=setup-postgres to restore operation."
|
||||
|
||||
- import_tasks: tasks/setup_postgres.yml
|
||||
- ansible.builtin.import_tasks: tasks/setup_postgres.yml
|
||||
|
||||
- name: Ensure matrix-postgres autoruns and is restarted
|
||||
ansible.builtin.service:
|
||||
@@ -112,7 +112,7 @@
|
||||
daemon_reload: true
|
||||
|
||||
- name: Wait a bit, so that Postgres can start
|
||||
wait_for:
|
||||
ansible.builtin.wait_for:
|
||||
timeout: "{{ postgres_start_wait_time }}"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
|
Reference in New Issue
Block a user