kewlfft / ansible-aur

Ansible module to manage packages from the AUR
GNU General Public License v3.0
299 stars 47 forks source link

Using this module as a backend for ansible.builtin.package #71

Closed gardar closed 1 year ago

gardar commented 2 years ago

Is it possible to use this module as a backend for the package core ansible module?

This modules manages packages on a target without specifying a package manager module (like ansible.builtin.yum, ansible.builtin.apt, …). It is convenient to use in an heterogeneous environment of machines without having to create a specific task for each package manager.

Or is there perhaps something that limits the package module from using third party modues as a backend?

gotmax23 commented 2 years ago

I'm not sure. Honestly, I think we'd be better off merging this module with community.general.pacman.

gotmax23 commented 2 years ago

Assuming you've installed the kewlfft.aur collection, what happens in you pass use: kewlfft.aur.aur to the package module?

gardar commented 2 years ago

Yep, it works, I had tried using the legacy name aur and also tried using makepkg, etc directly without luck.

TASK [gardar.common : Install yay aur helper] **********************************
task path: /home/g/ansible/roles/gardar.common/tasks/distro/archlinux.yml:17
redirecting (type: connection) ansible.builtin.podman to containers.podman.podman
META: noop
META: noop
changed: [archlinux] => {"changed": true, "helper": "makepkg", "msg": "installed package(s)", "rc": 0}

TASK [gardar.common : Install aur packages] ************************************
task path: /home/g/ansible/roles/gardar.common/tasks/distro/archlinux.yml:27
META: noop
META: noop
redirecting (type: connection) ansible.builtin.podman to containers.podman.podman
changed: [archlinux] => {"changed": true, "helper": "yay", "msg": "installed package(s)", "rc": 0}
META: noop

Now the remaining question is if I can pass a additional use parameter to the package module, to force it to use a specific aur helper.