mirror of
https://github.com/PyratLabs/ansible-role-k3s
synced 2024-12-05 02:40:19 +01:00
kubectl commands on node must use short name (#220)
Co-authored-by: Igor Tretyak <itretyak@ptsecurity.com>
This commit is contained in:
parent
cfd9400edf
commit
0c0d3bb38d
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
|||
- name: Ensure uninstalled nodes are drained # noqa no-changed-when
|
||||
ansible.builtin.command:
|
||||
cmd: >-
|
||||
{{ k3s_install_dir }}/kubectl drain {{ item }}
|
||||
{{ k3s_install_dir }}/kubectl drain {{ hostvars[item].ansible_hostname }}
|
||||
--ignore-daemonsets
|
||||
--{{ k3s_drain_command[ansible_version.string is version_compare('1.22', '>=')] }}
|
||||
--force
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
- name: Ensure uninstalled nodes are removed # noqa no-changed-when
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ k3s_install_dir }}/kubectl delete node {{ item }}"
|
||||
cmd: "{{ k3s_install_dir }}/kubectl delete node {{ hostvars[item].ansible_hostname }}"
|
||||
delegate_to: "{{ k3s_control_delegate }}"
|
||||
run_once: true
|
||||
when:
|
||||
|
|
Loading…
Reference in a new issue