{"failed": true} msg: Failed to lock apt for exclusive operation FATAL: all hosts have already failed -- aborting

I get the error ({“failed”: true} msg: Failed to lock apt for exclusive operationFATAL: all hosts have already failed – aborting)

as specified in the subject each time i run my playbook.

But i can successfully ssh into the remote host

this is the content of my playbook

  • hosts: 172.30.0.12
    roles:
  • java
  • tomcat

sudo: True

vars:
tomcat_version: 7
java_version: 7
tomcat_jmxremote_enable: true
tomcat_jmxremote_port: 10003

Kindly help me figure this out

unless you are running as root I would expect this error, you might
want to uncomment #sudo: True