Running a deploy-stack on monolith fails on the pgbouncer install step:
TASK [pgbouncer : pgbouncer install] ***************************************************************************************************************************************************** fatal: [10.2.0.4]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"}
PLAY RECAP ******************************************************************************************************************************************************************************* 10.2.0.4 : ok=145 changed=11 unreachable=0 failed=1 skipped=109 rescued=0 ignored=0
The apt log at /var/log/apt/history.log shows:
Start-Date: 2025-08-23 10:42:35
Commandline: /usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install git
Requested-By: ansible (3001)
Upgrade: git:amd64 (1:2.49.0-2~ppa1~ubuntu22.04.1, 1:2.51.0-0ppa2~ubuntu22.04.1), git-man:amd64 (1:2.49.0-2~ppa1~ubuntu22.04.1, 1:2.51.0-0ppa2~ubuntu22.04.1)
End-Date: 2025-08-23 10:42:41
When running
/usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install git
as the ansible user, the error is
sudo -u ansible /usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install git
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
I assume it needs to be run with sudo but isn’t being?
Thanks