diff --git a/ansible/roles/ovos_installer/tasks/ovos.yml b/ansible/roles/ovos_installer/tasks/ovos.yml index b638c010..9eb8f662 100644 --- a/ansible/roles/ovos_installer/tasks/ovos.yml +++ b/ansible/roles/ovos_installer/tasks/ovos.yml @@ -1,4 +1,38 @@ --- +- name: Define directories to backup before uninstall + ansible.builtin.set_fact: + ovos_directories_backup: + - "{{ ovos_installer_user_home }}/ovos" + - "{{ ovos_installer_user_home }}/hivemind" + - "{{ ovos_installer_user_home }}/.config/wireplumber" + when: ovos_installer_method == "containers" + tags: + - uninstall + +- name: Define directories to backup before uninstall + ansible.builtin.set_fact: + ovos_directories_backup: + - "{{ ovos_installer_user_home }}/.config/systemd" + - "{{ ovos_installer_user_home }}/.config/mycroft" + - "{{ ovos_installer_user_home }}/.config/hivemind" + - "{{ ovos_installer_user_home }}/.config/OpenVoiceOS" + - "{{ ovos_installer_user_home }}/.config/wireplumber" + - "{{ ovos_installer_user_home }}/.local/share/hivemind" + when: ovos_installer_method == "virtualenv" + tags: + - uninstall + +- name: Backup existing configurations before uninstall + community.general.archive: + path: "{{ ovos_directories_backup }}" + dest: "{{ ovos_installer_user_home }}/" + owner: "{{ ovos_installer_user }}" + group: "{{ ovos_installer_group }}" + mode: "0755" + format: bz2 + tags: + - uninstall + - name: Create directories ansible.builtin.file: path: "{{ item.directory }}"