diff --git a/roles/remove-node/post-remove/tasks/main.yml b/roles/remove-node/post-remove/tasks/main.yml index 994cf3dc3..a0dbcd6fe 100644 --- a/roles/remove-node/post-remove/tasks/main.yml +++ b/roles/remove-node/post-remove/tasks/main.yml @@ -1,16 +1,4 @@ --- -- name: Lookup node IP in kubernetes - shell: >- - {{ bin_dir }}/kubectl get nodes {{ node }} - -o jsonpath='{range.status.addresses[?(@.type=="InternalIP")]}{.address}{"\n"}{end}' - register: remove_node_ip - when: - - inventory_hostname in groups['etcd'] - - ip is not defined - - access_ip is not defined - delegate_to: "{{ groups['etcd']|first }}" - failed_when: false - - name: Delete node command: "{{ bin_dir }}/kubectl delete node {{ inventory_hostname }}" delegate_to: "{{ groups['kube-master']|first }}" diff --git a/roles/remove-node/remove-etcd-node/tasks/main.yml b/roles/remove-node/remove-etcd-node/tasks/main.yml index 125711a6c..ddde9ed27 100644 --- a/roles/remove-node/remove-etcd-node/tasks/main.yml +++ b/roles/remove-node/remove-etcd-node/tasks/main.yml @@ -1,4 +1,16 @@ --- +- name: Lookup node IP in kubernetes + shell: >- + {{ bin_dir }}/kubectl get nodes {{ node }} + -o jsonpath='{range.status.addresses[?(@.type=="InternalIP")]}{.address}{"\n"}{end}' + register: remove_node_ip + when: + - inventory_hostname in groups['etcd'] + - ip is not defined + - access_ip is not defined + delegate_to: "{{ groups['etcd']|first }}" + failed_when: false + - name: Set node IP set_fact: node_ip: "{{ ip | default(access_ip | default(remove_node_ip.stdout)) | trim }}" diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index ff50dbafe..6975d226f 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: reset | include file with pre-reset tasks specific to the network_plugin if exists include_tasks: "{{ (role_path + '/../network_plugin/' + kube_network_plugin + '/tasks/pre-reset.yml') | realpath }}" when: @@ -142,7 +141,7 @@ - name: reset | unmount kubelet dirs command: umount -f {{ item }} - with_items: '{{ mounted_dirs.stdout_lines }}' + with_items: "{{ mounted_dirs.stdout_lines }}" register: umount_dir retries: 4 until: umount_dir.rc == 0 @@ -296,7 +295,7 @@ {%- else -%} network {%- endif -%} - {%- elif ansible_distribution == "Ubuntu" and ansible_distribution_release == "bionic" -%} + {%- elif ansible_distribution == "Ubuntu" and ansible_distribution_release in ["bionic", "focal"] -%} systemd-networkd {%- elif ansible_os_family == "Debian" -%} networking