Skip to content

Commit

Permalink
Better cleanup with reset playbook (#353)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
anon-software committed Aug 22, 2024
1 parent 61ba8b5 commit 3e0c982
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions playbooks/reset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@
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

0 comments on commit 3e0c982

Please sign in to comment.