I configured AWX to support Manual SCM. I am able to create Projects with Manual SCM by selecting folders created under /opt/awx_projects (mounted to /var/lib/awx/projects).
When creating a template, I can select the project but the playbooks within the folder are not shown in the Playbook selection field.
Configure AWX to map volumes to /opt/awx_projects (uncomment line in inventory).
Create several directories under /opt/awx_projects and add playbooks.
Make sure that folders and files are accessible.
Create a project and chose manual SCM.
Select a directory.
Create a template and chose the project.
Playbooks in the folder should be selectable
No playbook is shown
Working fine with GitGub as SCM.
Just create a new project using Git as SCM. Download works and the playbook is downloaded to /opt/awx_projects.
drwxr-xr-x 3 root root 63 Mar 18 10:36 _13__azure
-rw-r--r-- 1 root root 109 Mar 18 10:36 azure-vm.poweron.yml
-rw-r--r-- 1 root root 11 Mar 18 10:36 README.md
When creating a template, the playbook cannot be selected.
Both containers (awx_web, awx_task) can access the project folders:
[extedoria@devopsawx-awx awx_projects]$ sudo docker exec -it awx_task /bin/bash
[root@awx awx]# ls -l /var/lib/awx/projects
total 0
drwxr-xr-x 3 root root 59 Mar 19 11:27 _17__keith_github
drwxr-xr-x 3 root root 63 Mar 19 11:30 _18__azure_details
drwxr-xr-x 2 root root 26 Mar 19 11:23 windows
[root@awx awx]# ls -l /var/lib/awx/projects/_18__azure_details/
total 8
-rw-r--r-- 1 root root 109 Mar 19 11:30 azure-vm.poweron.yml
-rw-r--r-- 1 root root 11 Mar 19 11:30 README.md
[root@awx awx]# exit
exit
[extedoria@devopsawx-awx awx_projects]$ sudo docker exec -it awx_web /bin/bash
[root@awxweb awx]# ls -l /var/lib/awx/projects
total 0
drwxr-xr-x 3 root root 59 Mar 19 11:27 _17__keith_github
drwxr-xr-x 3 root root 63 Mar 19 11:30 _18__azure_details
drwxr-xr-x 2 root root 26 Mar 19 11:23 windows
I added another playbook to a Git Project that worked (playbook could be selected) and downloaded it again. The playbook is available under /opt/awx_projects/_7__keith_git
Now I tried to select a different playbook from that project but it is not displayed.
The awx postgres db shows no playbooks for additionally projects:
awx=# select local_path, playbook_files from main_project;
local_path | playbook_files
------------------+---------------------
windows | []
_21__keith_git | []
_4__demo_project | ["hello_world.yml"]
(3 rows)
playbooks are indexed on-demand: https://github.com/ansible/awx/blob/devel/awx/main/models/projects.py#L191
Your playbooks need to look like playbooks, see here: https://github.com/ansible/awx/blob/devel/awx/main/utils/ansible.py#L38
See the regular expression here: https://github.com/ansible/awx/blob/devel/awx/main/utils/ansible.py#L16
Can you verify that your plalybooks look like what is expected?
Thank you for the hint. It is working now.
Most helpful comment
playbooks are indexed on-demand: https://github.com/ansible/awx/blob/devel/awx/main/models/projects.py#L191
Your playbooks need to look like playbooks, see here: https://github.com/ansible/awx/blob/devel/awx/main/utils/ansible.py#L38
See the regular expression here: https://github.com/ansible/awx/blob/devel/awx/main/utils/ansible.py#L16
Can you verify that your plalybooks look like what is expected?