mnussbaum / ansible-yay Goto Github PK
View Code? Open in Web Editor NEWAnsible module to install AUR packages with yay
License: MIT License
Ansible module to install AUR packages with yay
License: MIT License
I'm trying to run this module and I'm getting this error:
Failed to install package brave-bin, because: sudo: Account or password is expired, reset your password and try again
sudo: unable to change expired password: Authentication token manipulation error
sudo: a password is required
I think this is because my root login is disabled, however I had no problems whatsoever with other tasks using community.general.pacman
and become: true
.
Re-enabling root fixes the problem.
Any idea on how to fix this?
hi, did you consider making this available through the ansible-galaxy?
Maybe some extra arguments possible like the community pacman module?
https://docs.ansible.com/ansible/latest/collections/community/general/pacman_module.html
Would allow you to exclude certain packages, etc.
Is it normal for this Ansible module to install both the normal (do-agent) and debug (do-agent-debug) variants of a package it builds?
yay
module doesn't keep track of the packages installed, it re-installs them because of the default behavior of yay (see below for the explanation).
I ran this example playbook on Vagrant.
# test.yml
---
- name: Test
hosts: all
gather_facts: true
tasks:
- name: Install ntp
pacman:
name: extra/ntp
state: present
become: true
- name: Install git
yay:
name: extra/git
state: present
ansible-playbook -v -i tests/vagrant/vagrant.inventory playbooks/test.yml
PLAY [Test] ***************************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************
ok: [192.168.56.2]
TASK [Install ntp] ********************************************************************************************************************************************
changed: [192.168.56.2] => {"changed": true, "msg": "installed 1 package(s). ", "stderr": "", "stderr_lines": [], "stdout": "resolving dependencies.."]}
TASK [Install git] ********************************************************************************************************************************************
changed: [192.168.56.2] => {"changed": true, "msg": "installed 1 package(s). ", "stderr": "", "stderr_lines": [], "stdout": "resolving dependencies.."]}
PLAY RECAP ****************************************************************************************************************************************************
192.168.56.2 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Result: 2 changed
Expected: 2 changed
ansible-playbook -v -i tests/vagrant/vagrant.inventory playbooks/test.yml
PLAY [Test] ***************************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************
ok: [192.168.56.2]
TASK [Install ntp] ********************************************************************************************************************************************
ok: [192.168.56.2] => {"changed": false, "msg": "package(s) already installed. "}
TASK [Install git] ********************************************************************************************************************************************
changed: [192.168.56.2] => {"changed": true, "msg": "Installed 1 package(s). "}
PLAY RECAP ****************************************************************************************************************************************************
192.168.56.2 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Result: 1 changed
Expected: 0 changed
I think the solution is to add the --needed
tag to the default install command.
--needed Do not reinstall the targets that are already up-to-date.
https://archlinux.org/pacman/pacman.8.html#_upgrade_options_apply_to_em_s_em_and_em_u_em_a_id_uo_a
$ yay -S extra/git
warning: git-2.35.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (1) git-2.35.1-1
Total Installed Size: 33,31 MiB
Net Upgrade Size: 0,00 MiB
:: Proceed with installation? [Y/n] ^C
Interrupt signal received
$ yay -S extra/git --needed
warning: git-2.35.1-1 is up to date -- skipping
there is nothing to do
$ echo $?
0
Hi,
if I run the task without become:yes it stops without going any furthe, otherwise I get the error "could not update package db: Please avoid running yay as root/sudo."
If I run yay manually I get the same error if I prepend it with sudo, otherwise I get a prompt [sudo] password for <user>:
Any idea what I'm doing wrong?
Edit: This is my task:
- name: Update system
#become: yes
yay:
update_cache: yes
upgrade: yes
could you create a pypi package so one could install it via pip install ansible-yay
?
When running this task ansible is unable to continue. To be more specific, it stops when installing perl-image-exiftool
.
I think the reason for it to stop is that when installing perl-image-exiftool
we need to specify which of the dependencies we want - I don't remember specifically which but I can fetch the names later.
I'm not sure if this can be categorized as an issue once this is like a manual step for installing such packages. Anyhow, I'd appreciate some help on how to work around these cases or, even better, a fix that works around it.
I've just ran for the first time this module.
I'm installing some AUR packages with it, but always that it start the task, it request me my sudo password:
TASK [role : Task name] ***
[sudo] password for darguima:
changed: [localhost]
I don't know if this is the normal behavior, but it would be nice if I doesn't need insert my password, as long as I pass the --ask-become-pass
, and if I'm installing something with pacman for example, using the become: true
I don't need passwords.
Just because I want run something automatized that don't need human interaction.
Is this a bug, or the normal behavior?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.