/var/lib/awx directory is not created

I have tried installing AWX. /var/lib/awx directory is not created. When I build it myself, the manual projects cannot be run, the playbooks are not found: “There are no available playbook directories in /var/lib/awx/projects. Either that directory is empty, or all of the contents are already assigned to other projects. Create a new directory there and make sure the playbook files can be read by the “awx” system user, or have AWX directly retrieve your playbooks from source control using the Source Control Type option above.”

I used the guide https://computingforgeeks.com/how-to-install-ansible-awx-on-ubuntu-linux/?expand_article=1#google_vignette I also tried other similar guides but they also gave the same result.

If I look at the /var/lib directory in the container (kubectl exec -ti deploy/awx-web -c redis – /bin/bash), there are very few files in that directory, the awx directory is not there either.

Do I have to create and link this directory myself?

kubectl exec -ti deploy/awx-web -c redis – /bin/bash

You should dig into the awx-web container instead of redis container: kubectl exec -ti deploy/awx-web -c awx-web – /bin/bash

Also similar topic is here: AWX: There are no available playbook directories in /var/lib/awx/projects

1 Like

Hi,

Thank you for the answer!
Neither /var/lib nor /opt directory (outside of containers) contains any AWX or ansible directory

kubectl exec -ti deploy/awx-web -c awx-web – /bin/bash
bash-5.1$
cd /var/lib/awx/
bash-5.1$ ls -la
total 36
drwxrwxr-x 1 root root 4096 Nov 13 11:33 .
drwxr-xr-x 1 root root 4096 Nov 13 11:08 …
prw------- 1 awx root 0 Nov 13 11:09 awxfifo
-rw------- 1 awx root 187 Nov 13 11:33 .bash_history
drwxr-xr-x 3 root root 4096 Nov 7 19:16 .local
drwxrwxr-x 2 root 1000 4096 Nov 13 10:31 projects
drwxr-xr-x 3 root root 4096 Nov 7 19:16 public
drwxrwxr-x 1 root root 4096 Nov 7 19:16 rsyslog
drwxr-xr-x 3 root root 4096 Nov 7 19:05 venv
bash-5.1$ id
uid=1000(awx) gid=0(root) groups=0(root)
bash-5.1$ mkdir projects/test1
mkdir: cannot create directory ‘projects/test1’: Permission denied
bash-5.1$ ls -l projects/
total 0
bash-5.1$

Can I add it now?

Is it correct that you want to use a Manual type projects? If that is not your goal, please let me know just in case I am not sure that trying to create a directory on /var/lib/awx/projects in the first place is the right approach.

If you want to use Manual type projects, this is only applicable for single node K3s, but the simplest way for you is finding the actual directory for your /var/lib/awx on your K3s host, and create and place directories and files there.

# Find your volume name for your PVC for projects
$ VOLUME_NAME=$(kubectl -n awx get pvc awx-projects-claim -o jsonpath='{.spec.volumeName}')

$ echo $VOLUME_NAME
pvc-d816835b-327f-4faf-8467-a567b984b148

# Find the directory for this volume
$ sudo ls -ld /var/lib/rancher/k3s/storage/${VOLUME_NAME}_awx_awx-projects-claim
drwxrwxr-x. 4 root kuro 79 Nov 15 21:22 /var/lib/rancher/k3s/storage/pvc-d816835b-327f-4faf-8467-a567b984b148_awx_awx-projects-claim

This directory on your K3s host is mounted as /var/lib/awx/projects on awx-web and awx-task pod, so if you create directories and files there, you should be able to use it as Manual type project.

If you don’t like the random name pvc-*, my guide is good example that allows you to use /data/projects on the k3s host as project directory in AWX: GitHub - kurokobo/awx-on-k3s: An example implementation of AWX on single node K3s using AWX Operator, with easy-to-use simplified configuration with ownership of data and passwords.

1 Like