I bumped into Failed to lock apt for exclusive operation issue: https://github.com/geerlingguy/ansible-role-apache/issues/50
Failed to lock apt for exclusive operation
I posted a lot of details in Gi
Ok, so there is nothing wrong with Ansible, SSH or the role. It is just that apt in Debian can get really confused and lock itself out. As I was using a home-brewed Docker VM, I only had to recreate my image and container to get APT working again.