Skip to content

Commit

Permalink
Change reset deletion order to avoid racecondition
Browse files Browse the repository at this point in the history
If the k3s binary is launched after the deletion of `/var/lib/rancher/k3s`, k3s
will automatically create this directory. This change deletes the k3s binary
first so that it cannot be called after `/var/lib/rancher/k3s` is deleted

Signed-off-by: Julien DOCHE <julien.doche@gmail.com>
  • Loading branch information
St0rmingBr4in committed Feb 18, 2021
1 parent f1163ff commit 54629a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roles/reset/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
name: "{{ item }}"
state: absent
with_items:
- /usr/local/bin/k3s
- "{{ systemd_dir }}/k3s.service"
- "{{ systemd_dir }}/k3s-node.service"
- /etc/rancher/k3s
- /var/lib/kubelet
- /var/lib/rancher/k3s
- /usr/local/bin/k3s

- name: daemon_reload
systemd:
Expand Down

0 comments on commit 54629a4

Please sign in to comment.