Awx: Playbooks in Projects with Manual SCM are not shown

Created on 18 Mar 2018  路  5Comments  路  Source: ansible/awx

ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • Project
SUMMARY

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.

ENVIRONMENT
  • AWX version: 1.0.4
  • AWX install method: docker on linux
  • Ansible version: 2.4.2.0
  • Operating System: CentOS Linux release 7.4.1708
  • Web Browser: Chrome
STEPS TO REPRODUCE

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.

EXPECTED RESULTS

Playbooks in the folder should be selectable

ACTUAL RESULTS

No playbook is shown

ADDITIONAL INFORMATION

Working fine with GitGub as SCM.

api medium needs_info bug

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?

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings