From 759a6c7f50d4a2532f90e2b93dd0088272bc2f09 Mon Sep 17 00:00:00 2001 From: goldyfruit Date: Fri, 28 Jun 2024 16:59:50 -0400 Subject: [PATCH 1/2] [backup] Add backup support when uninstall --- ansible/roles/ovos_installer/tasks/ovos.yml | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) 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 }}" From e19abe566f3162ec113c22d07c9af173b1c68616 Mon Sep 17 00:00:00 2001 From: goldyfruit Date: Fri, 28 Jun 2024 17:46:11 -0400 Subject: [PATCH 2/2] [backup] Better support and compress in gz --- ansible/roles/ovos_installer/tasks/ovos.yml | 30 ++++++++------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/ansible/roles/ovos_installer/tasks/ovos.yml b/ansible/roles/ovos_installer/tasks/ovos.yml index 9eb8f662..881b17d9 100644 --- a/ansible/roles/ovos_installer/tasks/ovos.yml +++ b/ansible/roles/ovos_installer/tasks/ovos.yml @@ -2,34 +2,26 @@ - 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" + - "{{ ovos_installer_user_home }}/ovos/*" + - "{{ ovos_installer_user_home }}/hivemind/*" + - "{{ ovos_installer_user_home }}/.config/systemd/user/*" + - "{{ 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/*" tags: - uninstall - name: Backup existing configurations before uninstall community.general.archive: path: "{{ ovos_directories_backup }}" - dest: "{{ ovos_installer_user_home }}/" + dest: "{{ ovos_installer_user_home }}/ovos-backup.tar.gz" owner: "{{ ovos_installer_user }}" group: "{{ ovos_installer_group }}" mode: "0755" - format: bz2 + format: gz + force_archive: true tags: - uninstall