-
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
Refactor bootstrap-os #10983
Refactor bootstrap-os #10983
Conversation
be82f54
to
ff9539c
Compare
actually I wonder if we could rely more on ansible python autodiscovery since I guess it has improved since the time where ansible_python_interpreter workarounds was added in bootstrap 🤔 |
Coreos was replaced by flatcar in 058438a but the file was copied instead of moved.
Using directly ID and VARIANT_ID with first_found allow for less manual includes. Distro "families" are simply handled by symlinks.
ff9539c
to
482eb9f
Compare
- Allows users to override the chosen python_interpreter with group_vars easily (group_vars have lesser precedence than facts) - Allows us to use vars at the task scope to use a virtual env Ansible python discovery has improved, so those workarounds should not be necessary anymore. Special workaround for Flatcar, due to upstream ansible not willing to support it.
482eb9f
to
55f2aca
Compare
/cc @MrFreezeex |
- &search | ||
files: | ||
- "{{ os_release_dict['ID'] }}-{{ os_release_dict['VARIANT_ID'] }}.yml" | ||
- "{{ os_release_dict['ID'] }}.yml" |
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.
It's a bit a nit but I kinda like the fact there was a prefix "bootstrap-" there but I am fine with that if you prefer this.
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.
I tend to dislike repeated prefix stuff when there is already a "namespace" (roles/boostrap-os/tasks/bootstrap-*), it tends to make me cringe 😄 . But that's not something really important, I'm fine with either way.
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.
Hmm well to me that was more something to quickly distinguish the code that loads through this than the rest but as it's only main.yml it's not super important either
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.
Oh yeah I see that you mean. In that case I would rather have something like tasks/os/{{ distrib }}
. But since we currently only have the distro specific tasks / vars here, I think that's not really needed for now.
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.
Thanks for the very nice cleanup :D
/lgtm
/assign @liupeng0518 @mzaian
|
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.
Thanks a lot @VannTen and @MrFreezeex for the review
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MrFreezeex, mzaian, VannTen 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 |
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the boostrap-os include but didn't adapt the amazon linux tasks to the actual ID of amazon linux ('amzn') Re-enable the CI so we can avoid that kind of breakage.
* Remove leftover files for Coreos Coreos was replaced by flatcar in 058438a but the file was copied instead of moved. * Remove workarounds for resolved ansible issues * boostrap: Use first_found to include per distro Using directly ID and VARIANT_ID with first_found allow for less manual includes. Distro "families" are simply handled by symlinks. * boostrap: don't set ansible_python_interpreter - Allows users to override the chosen python_interpreter with group_vars easily (group_vars have lesser precedence than facts) - Allows us to use vars at the task scope to use a virtual env Ansible python discovery has improved, so those workarounds should not be necessary anymore. Special workaround for Flatcar, due to upstream ansible not willing to support it.
* Remove leftover files for Coreos Coreos was replaced by flatcar in 058438a but the file was copied instead of moved. * Remove workarounds for resolved ansible issues * boostrap: Use first_found to include per distro Using directly ID and VARIANT_ID with first_found allow for less manual includes. Distro "families" are simply handled by symlinks. * boostrap: don't set ansible_python_interpreter - Allows users to override the chosen python_interpreter with group_vars easily (group_vars have lesser precedence than facts) - Allows us to use vars at the task scope to use a virtual env Ansible python discovery has improved, so those workarounds should not be necessary anymore. Special workaround for Flatcar, due to upstream ansible not willing to support it.
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the boostrap-os include but didn't adapt the amazon linux tasks to the actual ID of amazon linux ('amzn') Re-enable the CI so we can avoid that kind of breakage.
* Remove leftover files for Coreos Coreos was replaced by flatcar in 058438a but the file was copied instead of moved. * Remove workarounds for resolved ansible issues * boostrap: Use first_found to include per distro Using directly ID and VARIANT_ID with first_found allow for less manual includes. Distro "families" are simply handled by symlinks. * boostrap: don't set ansible_python_interpreter - Allows users to override the chosen python_interpreter with group_vars easily (group_vars have lesser precedence than facts) - Allows us to use vars at the task scope to use a virtual env Ansible python discovery has improved, so those workarounds should not be necessary anymore. Special workaround for Flatcar, due to upstream ansible not willing to support it.
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the boostrap-os include but didn't adapt the amazon linux tasks to the actual ID of amazon linux ('amzn') Re-enable the CI so we can avoid that kind of breakage.
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the boostrap-os include but didn't adapt the amazon linux tasks to the actual ID of amazon linux ('amzn') Re-enable the CI so we can avoid that kind of breakage.
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the boostrap-os include but didn't adapt the amazon linux tasks to the actual ID of amazon linux ('amzn') Re-enable the CI so we can avoid that kind of breakage.
What type of PR is this?
/kind design
/kind cleanup
What this PR does / why we need it:
Special notes for your reviewer:
I'll submit the ansible upgrade in a separate but first fount is broken on 2.15
Does this PR introduce a user-facing change?: