Closed nqb closed 3 years ago
Thank you for this proposal @nqb ,
I have not enough followed the improvements on Ansible lately, my initial idea with having critical roles outside main repo was to allow anyone to clone/fork/use only that role for its needs without the need to get the full repo. I then used submodules for inclusion.
I like your proposai. On requirements.yml can you specify a specific commit on version: ? Otherwise we may lose this granularity offered by submodules (though I always load thé master, so that should not ne problematic).
Feel free to propose a PR ! Best Regards
On requirements.yml can you specify a specific commit on version: ?
Yes: https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#installing-multiple-roles-from-a-file (see examples)
But as I mentioned, we need a meta/main.yml
in each role in order to use ansible-galaxy
like described previously.
Do you want to create such a file for each of your linked role ?
You can find a minimal example I wrote here: https://github.com/inverse-inc/ansible-packetfence/blob/a033dab98c15705b72a82c028e65a1e2ee8eeed3/packetfence/roles/packetfence_install/meta/main.yml
After thinking a bit about my proposal, I think the best solution is to have everything in a simple repo (monorepo).
This has several advantages:
If you use several roles of this repo to set up an Odoo server and want to contribute, you have to fork several roles and create a PR in each repository.
meta/main.yml
to use ansible-galaxy
.ansible-galaxy
, you can use collections (archive with roles, plugins, playbooks) since ansible 2.9 and it's better to have everything in one repositoryLet me know which approach do you prefer.
From a code perspective I guess what you propose is the same as what we have today. I understand your point about contribution (where to create issue / pull requests), I will have to think more about this one, since for me having all roles in the same repo would limit the reuse of single role by other contributors (for instance people already having ansible will to only add/fork one of the docker_xxx role)
Hi @nqb I finally migrated all roles outside the main repo, since some of these should still be working but I am not using anymore, so I prefer to let people know which ones are still maintained. Also I wanted to move everything back to our GitLab server, but one can only connect to Ansible Galaxy using GitHub creds so I made a copy of each role on GitHub as well (the main repo being on out GitLab server). Since for now our GitLab server is not allowing external people to create account, people could still use GitHub for PR/Issues this way.
Hello @remi-filament,
Thanks for your message.
Please find below the corresponding commits :
I pushed roles independently on Galaxy, not collection, which does not make much sense to me (and I did not manage to import directory with my playbook in Ansible Galaxy directly...) Next step would be to not import roles from Ansible Galaxy but configure GitLab CI to push them automatically to Ansible Galaxy, and to allow people to create either anonymous issues on our Gitlab or to allow creation of account (but I do not think that people will create a dedicated account only to raise an issue or propose a PR, thus not sure this is the best way). Also you are the only who contributed to my roles so far, so I do not expect tons of contributions :smile: so I guess I could still manage from 2 different sources !
Eventually, you asked me some time ago if Odoo 14 was working, and we did not use it at that time, but we now have deployed a few customers with v14 now, so yes it is working !
I pushed roles independently on Galaxy, not collection, which does not make much sense to me (and I did not manage to import directory with my playbook in Ansible Galaxy directly...)
I will find it helpful because currently there is no release for each role. So you have to track each role by commit or use the latest revision.
Do you plan to manage releases in the future ?
Yes, I will look into it, good idea ! Best Regards,
@remi-filament,
Could you create me an account on your GitLab repository (sources.lefilament.com) ? IMHO, it makes more sense to open issues and create MR directly on sources.lefilament.com.
EDIT: you can find my email address in commit history.
Hello,
I suggest to use a
requirements.yml
+ anansible.cfg
at root of repository to avoid usage of git submodules in this repository.Example:
requirements.yml:
ansible.cfg:
Are you in favor of such change or do you prefer to keep things as-is ? If yes, I will open a PR.
NOTES:
meta/main.yml
in each role repository