kewlfft / ansible-aur

Ansible module to manage packages from the AUR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move to collection

gotmax23 opened this issue · comments

Hi,

Would you consider moving the aur module to a collection? Collections are now upstream's preferred method of distributing Ansible content, especially Python-based content. This would also make it easier to utilize the aur module within other Ansible content whether it's a standalone role or a collection.

For standalone roles, this would make it possible to utilize the module without creating a hard dependency on this role. Currently, the only method for calling the aur module within a role is by adding kewlfft.aur to dependencies: in meta/main.yml. This has the potentially unwanted side effect of automatically installing this role.

Currently, it is possible to use the aur module within roles inside collections with the same method: adding kewlfft.aur to dependencies: in the role's meta/main.yml. It is also necessary to add ansible.legacy to the collections: tag in the roles's meta/main.yml. See this section of the Ansible documentation for more info. Notably, this does not automatically install this role because it is not possible for roles in collections to have a hard dependency on standalone roles. It is also possible with the current implementation to use the aur module in a collection by installing the ansible-aur-git AUR package or by manually copying aur.py to ~/.ansible/plugins/modules/ as described in the README.

If you moved this module to a collection, it would be possible for other collections to depend on that collection, if desired. Otherwise, as long as the user installs the collection on their machine, they can use kewlfft.aur.aur (for example) in any playbook or role without needing to specify anything in meta/main.yml (for a role) or under roles: (in a playbook).

Thanks,
Maxwell

commented

I am not familiar with Ansible collections but would welcome a PR. Thanks for these explanations.