Hi
I have a number of ubuntu servers that I want to update using ansible via AWX. my current test playbook :
---
- hosts: all
tasks:
- name: Test Connection
ansible.builtin.ping:
- name: Update Cache
become: true
apt:
update_cache: true
is not work as expected on the ubuntu servers.
The servers that have the root user configured are fine. But the Ubuntu servers where the root user doesn't have a password set are failing with the following error:
"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)"
In AWX I have configured privilege escalation to use sudo but this doesnt help.
I have tried moving the become: yes statement but this did help.
Doe the apt module support the sudo ?
What have I missed ?
Thank you
Greg