From 95b0cfedb47ba250ad0755e99ef29a10aec7ae73 Mon Sep 17 00:00:00 2001 From: Marko Vukovic <8951449+anon-software@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:14:15 -0700 Subject: [PATCH 1/2] Better cleanup with reset playbook The install playbook adds some convenience commands into the user's .bashrc. If K3s is uninstalled, these commands produce errors. Since they are eaily identifiable, it is trivial to remove them to improve the user's experience. Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com> --- playbooks/reset.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/playbooks/reset.yml b/playbooks/reset.yml index c11048ae..d1b93024 100644 --- a/playbooks/reset.yml +++ b/playbooks/reset.yml @@ -31,3 +31,13 @@ ansible.builtin.file: path: /etc/rancher/k3s/config.yaml state: absent + +- name: Undo user setup + hosts: server + tasks: + - name: Remove K3s commands from ~/.bashrc + ansible.builtin.lineinfile: + path: "~{{ ansible_user }}/.bashrc" + search_string: "Added by k3s-ansible" + state: absent + From 304e0ba41d9453e39e597ba2dd1d20819cf25223 Mon Sep 17 00:00:00 2001 From: Marko Vukovic <8951449+anon-software@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:47:21 -0700 Subject: [PATCH 2/2] Fix lint errors Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com> --- playbooks/reset.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/playbooks/reset.yml b/playbooks/reset.yml index d1b93024..5ec49abc 100644 --- a/playbooks/reset.yml +++ b/playbooks/reset.yml @@ -35,9 +35,8 @@ - name: Undo user setup hosts: server tasks: - - name: Remove K3s commands from ~/.bashrc - ansible.builtin.lineinfile: - path: "~{{ ansible_user }}/.bashrc" - search_string: "Added by k3s-ansible" - state: absent - + - name: Remove K3s commands from ~/.bashrc + ansible.builtin.lineinfile: + path: "~{{ ansible_user }}/.bashrc" + search_string: "Added by k3s-ansible" + state: absent