diff --git a/roles/matrix-postgres/tasks/import_postgres.yml b/roles/matrix-postgres/tasks/import_postgres.yml index 7255c74e..25e1fe1c 100644 --- a/roles/matrix-postgres/tasks/import_postgres.yml +++ b/roles/matrix-postgres/tasks/import_postgres.yml @@ -22,13 +22,6 @@ msg: "File cannot be found on the server at {{ server_path_postgres_dump }}" when: not result_server_path_postgres_dump_stat.stat.exists -- import_tasks: tasks/util/detect_existing_postgres_version.yml - -- name: Abort, if no existing Postgres version detected - fail: - msg: "Could not find existing Postgres installation" - when: "not matrix_postgres_detected_existing" - # Defaults @@ -52,6 +45,13 @@ delegate_to: 127.0.0.1 become: false +- import_tasks: tasks/util/detect_existing_postgres_version.yml + +- name: Abort, if no existing Postgres version detected + fail: + msg: "Could not find existing Postgres installation" + when: "not matrix_postgres_detected_existing" + - name: Perform Postgres database import command: | /usr/bin/docker run --rm --name matrix-postgres-import \