Skip to content

Commit

Permalink
Fix uncached_hosts syntax error (#11985)
Browse files Browse the repository at this point in the history
* Fix uncached_hosts syntax error

Signed-off-by: panyintian.fu <[email protected]>

* Update roles/kubernetes/preinstall/tasks/0040-verify-settings.yml

Co-authored-by: ChengHao Yang <[email protected]>

---------

Signed-off-by: panyintian.fu <[email protected]>
Co-authored-by: Antoine Legrand <[email protected]>
Co-authored-by: ChengHao Yang <[email protected]>
  • Loading branch information
3 people authored Feb 21, 2025
1 parent a60ec1d commit e332375
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roles/kubernetes/preinstall/tasks/0040-verify-settings.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Stop if any host not in '--limit' does not have a fact cache
vars:
uncached_hosts: "{{ hostvars | dict2items | selectattr('value.ansible_default_ipv6', 'value.ansible_default_ipv4', 'undefined') | map(attribute='key') }}"
uncached_hosts: "{{ hostvars | dict2items | selectattr('value.ansible_default_ipv6', 'undefined') | selectattr('value.ansible_default_ipv4', 'undefined') | map(attribute='key') }}"
excluded_hosts: "{{ groups['k8s_cluster'] | difference(query('inventory_hostnames', ansible_limit)) }}"
assert:
that: uncached_hosts | intersect(excluded_hosts) == []
Expand Down

0 comments on commit e332375

Please sign in to comment.