-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
add gather facts on all hosts in inventory #5936
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LuckySB The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @mattymo |
This won't solve the related issue because you usually run scale.yml with --limit argument. As a result, you won't gather facts on all hosts here. We had previously a much worse task that used delegate_to to gather facts on all nodes. It slowed deployments tremendously and I had to remove it. |
Then we need to refactor the assembly cycle for variable falback_ips_base limit is evil |
can you run the scale playbook without limit? what would it do on the other nodes? |
Can using the setup module be a viable option to fine-tune this? |
@LuckySB Correct. For some reason the lookup in hostvars is failing for nodes without cache. That should be improved to fall back to 127.0.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment regarding hostvars lookup.
@@ -49,7 +49,7 @@ | |||
setup: | |||
delegate_to: "{{ item }}" | |||
delegate_facts: True | |||
when: hostvars[item]['ansible_machine_id'] is not defined | |||
when: hostvars[item]['ansible_default_ipv4'] is not defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be ansible_default_ipv4.address
?
Or using something like this:
when: (hostvars[item] is defined) and (hostvars[item]['ansible_default_ipv4'] is defined) and (hostvars[item]['ansible_default_ipv4']['address'] is defined)
Do we have a CI test for the scale playbook? I know we have one for the upgrade but couldn't find anything for scale up/down. |
final result will depend on |
no |
should we also add |
well. and set_facts: fallback_ips: hostvar.localhost.fallback_ips |
/hold |
delegate_to: "{{ item }}" | ||
delegate_facts: True | ||
when: hostvars[item]['ansible_default_ipv4'] is not defined | ||
with_items: "{{ groups['all'] }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to ignore errors, else we can't run the playbook when a host is down
/kind bug
What this PR does / why we need it:
playbook failed with scale.yml
no facts gather for kube-masters group, but need in fallback_ip_base vars definition
Which issue(s) this PR fixes:
Fixes #5927