diff --git a/shared/templates/template_ANSIBLE_file_permissions b/shared/templates/template_ANSIBLE_file_permissions index 50b64a898949..57c8394d2fe8 100644 --- a/shared/templates/template_ANSIBLE_file_permissions +++ b/shared/templates/template_ANSIBLE_file_permissions @@ -3,11 +3,15 @@ # strategy = configure # complexity = low # disruption = low +- name: Test for existence {{{ FILEPATH }}} + stat: + path: {{{ FILEPATH }}} + register: file_exists + - name: Ensure permission {{{ FILEMODE }}} on {{{ FILEPATH }}} file: path: {{{ FILEPATH }}} mode: {{{ FILEMODE }}} + when: file_exists.stat.exists and @ANSIBLE_PLATFORM_CONDITION@ tags: @ANSIBLE_TAGS@ - @ANSIBLE_ENSURE_PLATFORM@ -