From 9ac731a9d85104fdd4b6a5c57044789b01a5651d Mon Sep 17 00:00:00 2001 From: goldyfruit Date: Wed, 15 Jan 2025 10:15:25 -0500 Subject: [PATCH] [ansible/ovos] Make sure directory exists priot backup --- ansible/roles/ovos_installer/tasks/ovos.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ansible/roles/ovos_installer/tasks/ovos.yml b/ansible/roles/ovos_installer/tasks/ovos.yml index 01c1837..d63847d 100644 --- a/ansible/roles/ovos_installer/tasks/ovos.yml +++ b/ansible/roles/ovos_installer/tasks/ovos.yml @@ -14,6 +14,14 @@ tags: - uninstall +- name: Check if directory to backup exists + ansible.builtin.stat: + path: "{{ ovos_directories_backup }}" + register: _ovos_installer_directory_exists + when: ovos_installer_cleaning | bool + tags: + - uninstall + - name: Backup existing configurations before uninstall community.general.archive: path: "{{ ovos_directories_backup }}" @@ -23,7 +31,9 @@ mode: "0755" format: gz force_archive: true - when: ovos_installer_cleaning | bool + when: + - ovos_installer_cleaning | bool + - _ovos_installer_directory_exists.stat.exists | bool tags: - uninstall