ansible-aur icon indicating copy to clipboard operation
ansible-aur copied to clipboard

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

Open gardar opened this issue 2 years ago • 3 comments

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?

gardar avatar Jan 16 '22 11:01 gardar

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

gotmax23 avatar Jan 17 '22 08:01 gotmax23

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

gotmax23 avatar Jan 17 '22 08:01 gotmax23

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.

gardar avatar Jan 18 '22 01:01 gardar