so I started working with Ansible recently and created some playbooks to update our servers. Using these playbooks from console with Ansible installed on my local pc works fine, but trying to use these playbooks in AWX yields the following result:
No config file found; using defaults
Skipping callback 'awx_display', as we already have a stdout callback.
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
PLAYBOOK: update_ubuntu_intranet.yaml ******************************************
1 plays in ansible/playbooks/update_ubuntu_intranet.yaml
PLAY [intranet] ****************************************************************
TASK [Gathering Facts] *********************************************************
task path: /runner/project/ansible/playbooks/update_ubuntu_intranet.yaml:1
ok: [monitoring.docsinclouds.com]
TASK [Update all installed packages using APT module] **************************
task path: /runner/project/ansible/playbooks/update_ubuntu_intranet.yaml:5
fatal: [monitoring.docsinclouds.com]: 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)"}
PLAY RECAP *********************************************************************
monitoring.docsinclouds.com : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
It does work now! After realising I do not have the right priviliges, I found this article, https://groups.google.com/g/awx-project/c/xCmjY_92nEo and also had the same error, that a “Privilege Escalation Username” was defined on my Credential, after removing this entry, my job template is now running smoothly Thank you so much guys