this post was submitted on 21 Feb 2025
4 points (100.0% liked)

Lemmy Support

4731 readers
5 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
4
Lemmy ansible error (sh.itjust.works)
submitted 1 day ago* (last edited 1 day ago) by [email protected] to c/[email protected]
 

When I run the command: ansible-playbook -i inventory/hosts lemmy.yml I encounter an error. My user on the server has passwordless root access, and it is a completely fresh install. I have updated and rebooted the system, as well as tried updating without rebooting and without updating, but I continue to receive the same error message. I am using the latest build from two weeks ago.

I am using Ubuntu server 22.04.


FAILED! => {"changed": false, "msg": "Failed to lock apt for exclusive operation: Failed to lock directory /var/lib/apt/lists/: E:Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)"}
all 4 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 1 day ago (1 children)

Your own user might have root, but the ansibke user probably isn't.
You can enable ansible privilege escalation by adding become: true in your yaml file.

It is likely safer in the long run to set it for a specific task than globally.

[–] frankenswine 2 points 1 day ago

LPT you can set ansible output to human readable to prevent a you-are-not-a-json-parser stroke

[–] [email protected] 1 points 1 day ago

You may be running apt upgrade in another terminal, or it didn't complete properly in the past. Anyway it cannot install packages so you need to fix that.