Merge pull request #58 from PyratLabs/bugfix-k3s_node_data_dir

k3s_node_data_dir now set in templates
This commit is contained in:
Xan Manning 2020-10-22 11:45:41 +01:00 committed by GitHub
commit 93b95a9813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
- name: Ensure NODE_TOKEN is captured from control node - name: Ensure NODE_TOKEN is captured from control node
slurp: slurp:
path: "/var/lib/rancher/k3s/server/node-token" path: "{{ k3s_node_data_dir | default ('/var/lib/rancher/k3s') }}/server/node-token"
register: k3s_slurped_control_token register: k3s_slurped_control_token
delegate_to: "{{ k3s_control_delegate }}" delegate_to: "{{ k3s_control_delegate }}"
when: k3s_control_token is not defined and not ansible_check_mode when: k3s_control_token is not defined and not ansible_check_mode

View File

@ -2,7 +2,7 @@
[ $(id -u) -eq 0 ] || exec sudo $0 $@ [ $(id -u) -eq 0 ] || exec sudo $0 $@
for bin in /var/lib/rancher/k3s/data/**/bin/; do for bin in {{ k3s_node_data_dir | default('/var/lib/rancher/k3s') }}/data/**/bin/; do
[ -d "$bin" ] && export PATH=$bin:$PATH [ -d "$bin" ] && export PATH=$bin:$PATH
done done
@ -62,7 +62,7 @@ do_unmount() {
} }
do_unmount '/run/k3s' do_unmount '/run/k3s'
do_unmount '/var/lib/rancher/k3s' do_unmount '{{ k3s_node_data_dir | default('/var/lib/rancher/k3s') }}'
do_unmount '/var/lib/kubelet/pods' do_unmount '/var/lib/kubelet/pods'
do_unmount '/run/netns/cni-' do_unmount '/run/netns/cni-'

View File

@ -55,7 +55,7 @@ for bin in {{ k3s_install_dir }}/k3s*; do
done done
[ -d /etc/rancher/k3s ] && rm -rf /etc/rancher/k3s [ -d /etc/rancher/k3s ] && rm -rf /etc/rancher/k3s
[ -d /var/lib/rancher/k3s ] && rm -rf /var/lib/rancher/k3s [ -d {{ k3s_node_data_dir | default('/var/lib/rancher/k3s') }} ] && rm -rf {{ k3s_node_data_dir | default('/var/lib/rancher/k3s') }}
[ -d /var/lib/kubelet ] && rm -rf /var/lib/kubelet [ -d /var/lib/kubelet ] && rm -rf /var/lib/kubelet
[ -f /usr/local/bin/k3s-killall.sh ] && rm -f /usr/local/bin/k3s-killall.sh [ -f /usr/local/bin/k3s-killall.sh ] && rm -f /usr/local/bin/k3s-killall.sh