Could not find or access '/var/lib/awx/projects

Hello. Friends.
I have an Error with awx 23.4.0 currently I have it installed on only node with k3s and I installed it using storageclass hostPath storageClassName: awx-projects-volume
hostPath:
path: /data/projects
My question is how can I use local files so that they can work or be read from my project. My project is on GitHub and syncs well but I cannot use the local files from the /data/projects directory on my server. When I run my playbook, it generates the following error. Could not find or access '/var/lib/awx/projects it’s like it can’t find the path now on my server side the /data/projects directory is mounted in the container in /var/lib/awx/projects however when Executing tasks is as if the route does not enter, any help?

- my code!

 - hosts: "{{ servers | replace('\n',',') }}"
   gather_facts: false
   tasks:
   - name: copy file
     copy:
       src: /var/lib/awx/projects/_12__krs_trura_infra/projects/fs-lvm/fferrin1.txt
       dest: /tmp/fferrin2.txt

Hi, try the “Case 1: Read and write files on K3s host during Jobs” in my guide: awx-on-k3s/containergroup at main · kurokobo/awx-on-k3s · GitHub

Your playbook is launched in the ephemeral automation job pod instead of task nor web pod.
Once you place files in /data/projects on K3s host, they can indeed be available
on the web and task pods.

However, when a job is executed, for SCM-based projects, only the necessary files managed by SCM are transferred to a different path in the ephemeral automation job pod and executed.
Therefore, even if you place files in /data/projects , those files cannot be used within playbooks for SCM-based projects.

The guide I provided above introduces steps to mount /data/work on the K3s host to the ephemeral automation job pod.

Thanks, Kuro, this helped me a lot.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.