mirror of
https://github.com/PyratLabs/ansible-role-k3s.git
synced 2024-10-31 08:28:54 +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
@ -26,7 +26,7 @@
|
|||||||
- name: Ensure uninstalled nodes are drained # noqa no-changed-when
|
- name: Ensure uninstalled nodes are drained # noqa no-changed-when
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: >-
|
cmd: >-
|
||||||
{{ k3s_install_dir }}/kubectl drain {{ item }}
|
{{ k3s_install_dir }}/kubectl drain {{ hostvars[item].ansible_hostname }}
|
||||||
--ignore-daemonsets
|
--ignore-daemonsets
|
||||||
--{{ k3s_drain_command[ansible_version.string is version_compare('1.22', '>=')] }}
|
--{{ k3s_drain_command[ansible_version.string is version_compare('1.22', '>=')] }}
|
||||||
--force
|
--force
|
||||||
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
- name: Ensure uninstalled nodes are removed # noqa no-changed-when
|
- name: Ensure uninstalled nodes are removed # noqa no-changed-when
|
||||||
ansible.builtin.command:
|
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 }}"
|
delegate_to: "{{ k3s_control_delegate }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
when:
|
when:
|
||||||
|
Loading…
Reference in New Issue
Block a user