Skip to content
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

Small changes to be able to use this code as ansible collection #58

Closed
bartowl opened this issue Aug 27, 2021 · 0 comments · Fixed by #67
Closed

Small changes to be able to use this code as ansible collection #58

bartowl opened this issue Aug 27, 2021 · 0 comments · Fixed by #67
Assignees
Labels
enhancement New feature or request

Comments

@bartowl
Copy link

bartowl commented Aug 27, 2021

With ansible 2.10 ansible-galaxy suports collections, which consist of multiple roles packed and versioned as one thing.
This entire repository would require just very tiny changes to be considered as a ansible-galaxy collection.

This would allow fetching of particular version just by having requirements.yml file containing something like:

collections:
  - name: https://github.com/opitzconsulting/ansible-oracle
    type: git
    version: oc #(or any other branch/tag)

Then, before starting ansible on own config or inventory repo one would just need to execute following command:
ansible-galaxy collection install -r requirements.yml -p collections/
this would download entire ansible-oracle repository and place it under collections directory.

The usage of roles would then look identical, but the ansible play would need following lines added:

- name: Oracle Host configuration
  collections:
    - opitzconsulting.ansible-oracle #to be defined in top-level galaxy.yml file that would need to be created
  hosts: "{{ hostgroup }}"
  roles:
    - common
    - orahost
    ...

The changes required for this would be adding galaxy.yml file in top level, and for each role meta/main.yml with galaxy_{info,tags} . It would be also advised to move python modules from /libraries to /plugins/modules to comply with ansible-collection repository format. No other changes would be required!

With this issue it is also not intended to upload the collection to ansible-galaxy repositories (at least for now). It can be used by just referencing github branch/tag or even within forks...

Please qualify this Issue, when it will be ok i have already all changes needed for it and can easily prepare PR for that.

Best Regards,
BartOwl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants