Add ansible collection support - #791
Open
tod-uma wants to merge 7 commits into
Open
Conversation
tod-uma
marked this pull request as ready for review
March 8, 2024 15:19
adityapinglesf
requested review from
hendolim,
jonathan-vega-splunk and
ruomeiy-splunk
April 5, 2024 18:06
The original galaxy.yml was deliberately minimal ("just enough to get
it to work"). Fill in the fields the collections_galaxy_meta schema
recommends but doesn't require:
- description, so the collection is identifiable on its own in
ansible-galaxy search/list output, not just by namespace.name
- license, matching the repository's actual Apache-2.0 license
(docs/LICENSE.md)
- documentation/homepage/issues, pointing at the existing GitHub Pages
docs, repo, and issue tracker
- tags, replacing the single "collection" tag (redundant -- every
entry in Galaxy is a collection) with ones that describe what this
collection actually does
Also reset version to 1.0.0. The collection version should track the
collection's own release history, not the Splunk product version it
happens to manage -- 9.0.2-2 tied the two together from the first
commit and would need a new justification every time Splunk cuts a
release even if the collection's own Ansible code hadn't changed.
tod-uma
force-pushed
the
ansible-collection
branch
from
September 4, 2026 17:37
dfa7bad to
bfa5944
Compare
Contributor
Author
|
Rebased onto current We've been running this on a fork for a while now, alongside several other small fixes that have since merged cleanly here — #879, #883, #893, #894 — so figured it was worth bringing this one back into view too. Happy to adjust anything, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
This makes it possible to consume
splunk-ansibleas an Ansible collection — installed viaansible-galaxy collection installfrom a git-sourcedrequirements.yml— instead of vendoring or symlinking the repo into a project's roles path. That's useful for anyone integrating splunk-ansible's roles into their own playbooks (for example, installing the universal forwarder as one step of a broader Ansible-managed bootstrap process) without maintaining a private fork just to get collection semantics.Ansible collections need two things this repo doesn't have: a
galaxy.ymlmanifest, and modules living underplugins/modules/rather thanlibrary/(library/is the pre-collection, role-local module path; a collection's own modules resolve fromplugins/modules/— see Developing collections).What
galaxy.yml(new) — collection manifest.description,license(matches the repo's actual Apache-2.0 license),tags, anddocumentation/homepage/issueslinks to the existing docs site, repo, and issue tracker.versionstarts at1.0.0: a collection's version should track its own release history, not whatever Splunk build happens to be current, so it isn't tied to a product version number.library/→plugins/modules/— movessplunk_api.pyandes_ta_for_indexers.pyto the path a collection resolves its modules from. Done as renames (git mv), so history is preserved on both files.Verified
ansible-galaxy collection buildsucceeds and produces a validsplunk-splunk_ansible-1.0.0.tar.gz.Once installed as a collection:
Status
Opened in 2024 and stale since; rebased now onto current
developwith no conflicts — this range hasn't touchedlibrary/orgalaxy.yml, so both structural changes still apply cleanly. We've been running this on a fork since, alongside several other fixes that have since merged cleanly here (#879, #883, #893, #894), so happy to adjust anything ingalaxy.yml— tags especially — to whatever fits the project's own preference.