Closed quoterbox closed 3 months ago
Hey @quoterbox
Sorry, I don't have a role or playbook for that yet. Usually I spawn new virtual instances for services like that so I don't really have the need for it. I would guess you have to delete the /var/lib/rustdesk folders, config and the rustdesk binarys, but I did not test that...
Hey @quoterbox
Sorry, I don't have a role or playbook for that yet. Usually I spawn new virtual instances for services like that so I don't really have the need for it. I would guess you have to delete the /var/lib/rustdesk folders, config and the rustdesk binarys, but I did not test that...
I thought so. Yes, reinstalling the virtual server is an option, I agree. I just thought I couldn't find a rollback playbook in the code. Thanks for the useful playbook!
If I were to draft a rollback playbook for your role, could you guide me on what it would look like?
Do I need to perform any additional actions? For example, should I stop port listening or delete the directories: rustdeskhbbr_executable_path: '/usr/local/bin/hbbr' rustdeskhbbs_executable_path: '/usr/local/bin/hbbs' rustdesk__rustdesk_utils_executable_path: '/usr/local/bin/rustdesk-utils
I'm not a Linux user, so I might ask silly questions)
After stopping the systemd services you probavly should delete them too since this role is deploying systemd files in https://github.com/roles-ansible/ansible_role_rustdesk/blob/main/tasks/install_systemd.yml
So, a more complete list could be:
Thank you! That's useful
I've made a simple rollback playbook; maybe it will be useful for someone
---
- name: "Rollback RustDesk server setup"
hosts: www
become: yes
vars_files:
- ../group_vars/main.yml
tasks:
- name: "Gather service facts"
ansible.builtin.service_facts:
- name: "Check if rustdesk-hbbr service exists"
set_fact:
hbbr_service_exists: "{{ 'rustdesk-hbbr.service' in ansible_facts.services }}"
- name: "Stop and disable rustdesk-hbbr service"
ansible.builtin.systemd:
name: "rustdesk-hbbr"
state: stopped
enabled: no
when: hbbr_service_exists
ignore_errors: true
- name: "Check if rustdesk-hbbs service exists"
set_fact:
hbbs_service_exists: "{{ 'rustdesk-hbbs.service' in ansible_facts.services }}"
- name: "Stop and disable rustdesk-hbbs service"
ansible.builtin.systemd:
name: "rustdesk-hbbs"
state: stopped
enabled: no
when: hbbs_service_exists
ignore_errors: true
- name: "Remove rustdesk-hbbr service file"
ansible.builtin.file:
path: "/lib/systemd/system/rustdesk-hbbr.service"
state: absent
ignore_errors: true
- name: "Remove rustdesk-hbbs service file"
ansible.builtin.file:
path: "/lib/systemd/system/rustdesk-hbbs.service"
state: absent
ignore_errors: true
- name: "Reload systemd to apply changes"
ansible.builtin.systemd:
daemon_reload: true
ignore_errors: true
- name: "Remove hbbr binary"
ansible.builtin.file:
path: "{{ rustdesk__hbbr_executable_path }}"
state: absent
ignore_errors: true
- name: "Remove hbbs binary"
ansible.builtin.file:
path: "{{ rustdesk__hbbs_executable_path }}"
state: absent
ignore_errors: true
- name: "Remove rustdesk-utils binary"
ansible.builtin.file:
path: "{{ rustdesk__rustdesk_utils_executable_path }}"
state: absent
ignore_errors: true
- name: "Remove RustDesk configuration directory"
ansible.builtin.file:
path: "{{ rustdesk__home }}"
state: absent
- name: "Remove RustDesk user"
ansible.builtin.user:
name: "{{ rustdesk__user }}"
state: absent
ignore_errors: true
- name: "Remove RustDesk group"
ansible.builtin.group:
name: "{{ rustdesk__user }}"
state: absent
ignore_errors: true
Hello! Do you have a rollback playbook for this one role https://github.com/roles-ansible/ansible_role_rustdesk ?