Could not find or access FILE-XY on the Ansible Controller


unfortunately i get the following error while executing my playbook with cp module.

Could not find or access ‘/var/lib/awx/projects/ansible/serverconfigs/debian12/etc/aliases’ on the Ansible Controller

This File is available on this path.
From the pods task and web the path /var/lib/projects/ looks like:

sh-5.1$ ls -lha
total 20K
drwxrwxr-x. 4 awx 1000 4.0K Dec 14 11:10 .
drwxrwxr-x. 1 root root 4.0K Dec 14 11:17 …
drwxr-xr-x. 9 awx root 4.0K Apr 12 2023 _8__ansible
-rwxr-xr-x. 1 awx root 0 Jul 27 2022 _8__ansible.lock
lrwxrwxrwx. 1 awx root 11 Dec 14 11:10 ansible → _8__ansible
drwxr-xr-x. 3 awx root 4.0K Nov 4 2022 .__awx_cache

Any suggestions?

If i execute this playbook on my host without using AWX it works without any problems.

Am I correct in assuming that your playbook and serverconfigs/debian12/etc/aliases are stored in the same repository on the SCM?

If so you do not need to specify the file as an absolute path. Simply use relative path.
If you want to specify it as an absolute path anyway, you can probably specify /runner/project/serverconfigs/debian12/etc/aliases.

The playbook runs in a different pod that is neither web nor task, called the automation job pod.
This pod will not have /var/lib/awx/projects mounted, but will use the project directory otherwise transferred from task pod to /runner/project.
Thus, the paths to files under your project directory will be under /runner/project.

Thanks a lot, this helped!