Limit nodes in gather ansible_default_ipv4 #11370
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind feature
What this PR does / why we need it:
![image](https://private-user-images.githubusercontent.com/92532497/347358920-92554661-773d-4be9-9c39-7e973ed5a011.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1NjM0ODUsIm5iZiI6MTcyNTU2MzE4NSwicGF0aCI6Ii85MjUzMjQ5Ny8zNDczNTg5MjAtOTI1NTQ2NjEtNzczZC00YmU5LTljMzktN2U5NzNlZDVhMDExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA1VDE5MDYyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE3MzYzMWJhMDg2OWI5NzdmY2QwZmFiNmUzZWFiZWI3YmQ5ZGJiMWU3Zjg4ZjQ1YjFmY2IyYjc1ZTJlZDE1OTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xDlz1_XjbdVtIuLhwhiHxB1q3d5v2tT76poc8hdZO4o)
When we specify
--limit
on ansible-playbook cli which means we just want to restrict the operation to specified nodes. But for now, taskGather ansible_default_ipv4 from all hosts
will attempt to get the addresses of all hosts, it's unnecessary and cause time consumption.So this solution is limiting the execution host in
groups['kube_control_plane'][0]
and in--limit
, if--limit
exists.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: