kubernetes-sigs / kubespray

Deploy a Production Ready Kubernetes Cluster
Apache License 2.0
16.17k stars 6.48k forks source link

Local Vagrant test failed in macOS 15.0.1 #11690

Closed tico88612 closed 1 week ago

tico88612 commented 1 week ago

What happened?

TASK [kubernetes/preinstall : Stop if any host not in '--limit' does not have a fact cache] ***
fatal: [kub-1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ (hostvars | selectattr('ansible_default_ipv4', 'undefined')).keys() }}: 'list object' has no attribute 'keys'. 'list object' has no attribute 'keys'. {{ (hostvars | selectattr('ansible_default_ipv4', 'undefined')).keys() }}: 'list object' has no attribute 'keys'. 'list object' has no attribute 'keys'\n\nThe error appears to be in '/Users/jerry/working/kubespray/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Stop if any host not in '--limit' does not have a fact cache\n  ^ here\n"}

What did you expect to happen?

No error.

How can we reproduce it (as minimally and precisely as possible)?

vagrant up

OS

macOS 15.0.1

Version of Ansible

2.16.13

Version of Python

3.12.7

Version of Kubespray (commit)

a469c1c955143497983ec80dc11c38135daf4086

Network plugin used

calico

Full inventory with variables

Not related.

Command used to invoke ansible

vagrant up

Output of ansible run

TASK [kubernetes/preinstall : Stop if any host not in '--limit' does not have a fact cache] ***
fatal: [kub-1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ (hostvars | selectattr('ansible_default_ipv4', 'undefined')).keys() }}: 'list object' has no attribute 'keys'. 'list object' has no attribute 'keys'. {{ (hostvars | selectattr('ansible_default_ipv4', 'undefined')).keys() }}: 'list object' has no attribute 'keys'. 'list object' has no attribute 'keys'\n\nThe error appears to be in '/Users/jerry/working/kubespray/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Stop if any host not in '--limit' does not have a fact cache\n  ^ here\n"}

Anything else we need to know

No response

tico88612 commented 1 week ago

Kubespray recently merged #11598, but today I rebased to debug v1beta4 and found that it doesn't work.