Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubespray v2.24.0 facts gather missing #10933

Closed
gvrosun opened this issue Feb 16, 2024 · 5 comments
Closed

Kubespray v2.24.0 facts gather missing #10933

gvrosun opened this issue Feb 16, 2024 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@gvrosun
Copy link

gvrosun commented Feb 16, 2024

What happened?

Tried to create cluster using kubespray docker image v2.24.0 and got following error at no_proxy task
fatal: [master1 -> localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_hostname'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_hostname'\n\nThe error appears to be in '/kubespray/roles/kubespray-defaults/tasks/no_proxy.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: Set no_proxy to all assigned cluster IPs and hostnames\n ^ here\n"}

What did you expect to happen?

I noticed no where we gathered facts before reaching Set no_proxy to all assigned cluster IPs and hostnames task on no_proxy.yml

I expected facts gathers before reaching this task

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

You can just follow default setup procedure to reproduce the issue.

OS

Ubuntu 20.04

Version of Ansible

2.9.6

Version of Python

3.8.10

Version of Kubespray (commit)

v2.24.0

Network plugin used

calico

Full inventory with variables

docker exec -it kubespray ansible-playbook -i /inventory/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml

Command used to invoke ansible

ansible-playbook -i /inventory/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml

Output of ansible run

TASK [kubespray-defaults : Set no_proxy to all assigned cluster IPs and hostnames] ********************************************************************************************************************************************************** fatal: [master1 -> localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_hostname'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_hostname'\n\nThe error appears to be in '/kubespray/roles/kubespray-defaults/tasks/no_proxy.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: Set no_proxy to all assigned cluster IPs and hostnames\n ^ here\n"}

Anything else we need to know

I manually added gather_facts = true before reaching Set no_proxy to all assigned cluster IPs and hostnames task
And my issue for resolved

@gvrosun gvrosun added the kind/bug Categorizes issue or PR as related to a bug. label Feb 16, 2024
@mvandergiesen-sbp
Copy link

mvandergiesen-sbp commented Feb 21, 2024

This is fixed in master by f2bdd4b

@VannTen
Copy link
Contributor

VannTen commented Feb 27, 2024

/close
(Per above)

@k8s-ci-robot
Copy link
Contributor

@VannTen: Closing this issue.

In response to this:

/close
(Per above)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@maciej-markowski
Copy link

Hello,
I don't think the issue is resolved.

$ ansible --version
ansible [core 2.15.10]
(...)
$ ansible-galaxy collection list | grep kube
kubernetes.core               2.4.0
kubernetes.core               3.0.1
kubernetes_sigs.kubespray     2.24.1

When running cluster.yml playbok, with http_proxy and https_proxy set, but no_proxy undefined I get the same error.

@VannTen
Copy link
Contributor

VannTen commented Aug 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

5 participants