Skip to content

Publish roles and playbooks as Ansible galaxy collection #1756

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Lirt
Copy link

@Lirt Lirt commented May 20, 2025

Publish roles and playbooks as Ansible galaxy collection

This PR sets up CI that publishes ansible roles and playbooks as Ansible Galaxy Collection.

By pushing image-builder roles into galaxy we allow users to use them without cloning full git repository.

Related issues

Additional context

  • To publish also playbooks into collection, playbooks now must live under ./playbooks in the galaxy dir.
  • First version of the galaxy collection can be v0.2.0 to avoid breaking contract with users that clone this repository to set up CI from it.
  • Galaxy repository kubernetes_sigs has to be set up by a maintainer with access to kubernetes_sigs group. Possibly other namespace names could be used.
  • Additional README files had to be created to pass galaxy lint and LICENSEs added as symlinks.

Lirt added 2 commits May 13, 2025 14:55
Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign drew-viles for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 20, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @Lirt!

It looks like this is your first PR to kubernetes-sigs/image-builder 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/image-builder has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 20, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @Lirt. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 20, 2025
@drew-viles
Copy link
Contributor

Hey! Thanks for the PR.

Whilst this looks fine on the face of it, we are pretty low on maintainers and will potentially be losing another one soon. The only problem I have is that by adding in the Galaxy support, it will introduce another area of expectation around support of the feature. I personally wouldn't have the time to keep on top of this as well as all of the providers we currently support too. It's also only moving a subset of the roles over too which then brings in questions around what should be considered a Galaxy collection and what should be considered native to the repo.

I'll have to see how other maintainers feel about this as obviously this is one persons opinion 😄 but right now I'm not sure we could merge this in and provide it the support it would need moving forward and I don't want to see it just start to rot as a result.

@AverageMarcus
Copy link
Member

Adding my thoughts to this...

We generally want to only encourage a single way of using image-builder to ensure we can support it as much as possible. Officially this is via the container image we provide but we also understand that a lot of people run it directly by checking out the repo and running Make so we also support that.

We have had similar discussions in the past about other ways of using image-builder (such as from within EKS-Anywhere) and we've said we can't support it as we don't have the skills, time or resources to do so.

If we had more test coverage across the different providers and configurations to the point where we had more confidence in changes this might be a different discussion but right now it's too much of a burden on the maintainers and contributors unfortunately.

@Lirt
Copy link
Author

Lirt commented May 27, 2025

Hi,

thanks for looking at the PR.

This change shouldn't add extra maintenance burden. It only packages the ansible part into an ansible-native artifact. Any new role or playbook that is added under galaxy repository images/capi/ansible/ or images/capi/ansible/windows/) is automatically included into a collection. This change doesn't affect build processes - only ansible roles. Ansible artifacts are released automatically by tagging the repo (in the CI I added) (this repository is already being tagged).

It's also only moving a subset of the roles over too which then brings in questions around what should be considered a Galaxy collection and what should be considered native to the repo.

All of the roles are included in the collection (no subset). You can check it in my fork:

  1. https://galaxy.ansible.com/ui/repo/published/lirt/image_builder/content/?showing=role
  2. https://galaxy.ansible.com/ui/repo/published/lirt/image_builder_windows/content/

The MR required some renaming changes (generally playbooks must use absolute paths) and some file moves, but it was very small. People would need to get used to reference roles in playbooks with absolute paths.

Let me know what do you think.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish Ansible Galaxy Collection
4 participants