this post was submitted on 03 Feb 2024
10 points (100.0% liked)

Arch Linux

7750 readers
2 users here now

The beloved lightweight distro

founded 4 years ago
MODERATORS
 

I've started looking at Ansible to manage all the laptops, VMs, SBCs that I have running Arch Got the ol' pacman installs / updates working fine, but I'm having some problems understanding how to setup AUR to install some of those packages.

Main issue is where Ansible is basically doing everything as root, and AUR helpers don't want to run as root, so ok, create a 2nd non-root user first...

But even installing an AUR helper (yay) brings problems:

I can setup a folder in /tmp/aur , I can git clone the yay package, but then I have no idea how to run makepkg or then yay as that non-root user.

Does anyone have this already figured out?

Or... am I going about this the wrong way?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] mellejwz@lemmy.world 1 points 9 months ago (1 children)

Can't you change to a normal user with become? We do lots of stuff with Ansible as normal user. You should be able to create tasks that get executed as normal user and install yay and run makepkg, and then run yay to install packages.

[โ€“] Cyber@feddit.uk 1 points 9 months ago

Yeah, the problem was that some modules don't support become, so I just ran the whole thing that way.

For git and aur, to drop sudo I found that I have to use ansible-become variables to override just that step.

Live & learn