Open papanito opened 3 years ago
Somewhat related to #80?
@spantaleev yeah somewhat. Collections are quite new and I think it's easier to achieve as to my understanding one only has to create a specific structure
Collections follow a simple data structure. None of the directories are required unless you have specific content that belongs in one of them. A collection does require a galaxy.yml file at the root level of the collection. This file contains all of the metadata that Galaxy and other tools need in order to package, build and publish the collection:
collection/
├── docs/
├── galaxy.yml
├── meta/
│ └── runtime.yml
├── plugins/
│ ├── modules/
│ │ └── module1.py
│ ├── inventory/
│ └── .../
├── README.md
├── roles/
│ ├── role1/
│ ├── role2/
│ └── .../
├── playbooks/
│ ├── files/
│ ├── vars/
│ ├── templates/
│ └── tasks/
└── tests/
Which, if I see correctly, also eliminates the need to have the roles independent as stated in #80
Also important:
Role names are now limited to contain only lowercase alphanumeric characters, plus _ and start with an alpha character.
If you tell me this is something to try, I might have a look. Never made a collection, but definitively something I would like to help
@spantaleev here an example of how the repos should be restructured to be an ansible collection
https://github.com/papanito/matrix-docker-ansible-deploy/tree/papanito/ansible-collection
So far I only made the necessary changes to be able to upload it to ansible galaxy, still needs testing. Same goes for your playbook - it was moved to playbooks
folder but did not test it yet.
Also the README
should probably be updated. But before I go on I would like to hear your opinion/feedback.
This would be really nice. Are there plans to avoid breaking things for current users?
The playbooks may need some adjustments but I believe it should be doable without breaking the playbooks. Ultimately the roles are the same just they will just be belong to a collection...
As I understand this is a playbook which includes roles under
/roles
. As the roles are part of the content and not individually release, it would be nice to provide an ansible collection.Having a collection would rather make it easy to consume the matrix roles in your own playbook.