From 92b26ec84628d25a21acf51ff447d027791b15e3 Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Thu, 19 Aug 2021 18:05:47 +0800 Subject: [PATCH] check if matrix_vars.yml file exists --- roles/matrix-awx/tasks/rename_variables.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/matrix-awx/tasks/rename_variables.yml b/roles/matrix-awx/tasks/rename_variables.yml index 73a7a6bc1..6d82a0be7 100644 --- a/roles/matrix-awx/tasks/rename_variables.yml +++ b/roles/matrix-awx/tasks/rename_variables.yml @@ -1,9 +1,13 @@ +- name: Check if matrix_vars.yml file exists + stat: + path: "/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml" + register: matrix_vars_file + - name: Rename synapse presence variable delegate_to: 127.0.0.1 replace: path: "/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml" regexp: 'matrix_synapse_use_presence' replace: 'matrix_synapse_presence_enabled' - args: - creates: "/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml" + when: matrix_vars_file.stat.exists