Errors in my Playbook

173 views
Skip to first unread message

Michael Cooper

unread,
Feb 25, 2021, 5:30:05 PM2/25/21
to ansible...@googlegroups.com

Hello Everyone,

       First time poster here. By the way I am just now learning this. I am having issues with a playbook I am trying to run and I get this after the

This is what I ran -> ansible-playbook -i /etc/ansible/pi_hosts pi_update.yml

This was the result:

TASK [Update apt repo and cache on all Debian/Ubuntu boxes] *************************
fatal: [ohsrv01.cfs.loc]: 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)"}
fatal: [octopi.cfs.loc]: 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)"}

Not sure what's going on because I am using a legal user but do I need to put a provision for sudo and run the commands with sudo?

Thanks guys I appreciate your help,

--
Michael A Cooper
Linux Certified / Docker Certified
http://www.coopfire.com

Roberto Paz

unread,
Feb 25, 2021, 8:28:32 PM2/25/21
to Ansible Project
Are you running the playbook as root? If not,  add:

  become:yes

to the task or add "--become" to the command line.



Reply all
Reply to author
Forward
0 new messages