I bumped into Failed to lock apt for exclusive operation
issue:
https://github.com/geerlingguy/ansible-role-apache/issues/50
I posted a lot of details in Gi
I had remote_user: root
in my playbook, and this happened a lot. I couldn't figure out why, it was happening only on some roles but not others (but always at the same place.) I removed remote_user: root
and it stopped happening. I just use --become
and --become-user=root
. (Which I was using, but it still was randomly failing to get a lock for some reason.)