Compare `kubectl get nodes` with ansible_hostname, not ansible_fqdn/i… (#212)

Co-authored-by: Igor Tretyak <itretyak@ptsecurity.com>
This commit is contained in:
fragpit 2023-12-09 16:32:47 +03:00 committed by GitHub
parent 37fda0a953
commit b87991cc28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@
run_once: true
when:
- kubectl_get_nodes_result.stdout is defined
- item in kubectl_get_nodes_result.stdout
- hostvars[item].ansible_hostname in kubectl_get_nodes_result.stdout
- hostvars[item].k3s_state is defined
- hostvars[item].k3s_state == 'uninstalled'
loop: "{{ ansible_play_hosts }}"
@ -47,7 +47,7 @@
run_once: true
when:
- kubectl_get_nodes_result.stdout is defined
- item in kubectl_get_nodes_result.stdout
- hostvars[item].ansible_hostname in kubectl_get_nodes_result.stdout
- hostvars[item].k3s_state is defined
- hostvars[item].k3s_state == 'uninstalled'
loop: "{{ ansible_play_hosts }}"