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)"}
  • [email protected]A
    link
    fedilink
    arrow-up
    3
    ·
    2 days ago

    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.