Closed YaronL16 closed 2 weeks ago
Hi, is your playbook3.yml
valid playbook? AWX does not list all existing YAML files but list YAML files that can be determined as playbooks. Also there is no limitation about the depth of the sub directories.
https://github.com/ansible/awx/blob/devel/awx/main/utils/ansible.py/#L42-L66 this is how we determine if a yaml file "could be a playbook"
and here's the regex used to https://github.com/ansible/awx/blob/devel/awx/main/utils/ansible.py#L20 to scan the lines to determine if it "could be a playbook"
Hi, is your
playbook3.yml
valid playbook? AWX does not list all existing YAML files but list YAML files that can be determined as playbooks. Also there is no limitation about the depth of the sub directories.
@kurokobo all 3 playbooks are exactly the same. It couldn't be a problem with the file itself
and here's the regex used to https://github.com/ansible/awx/blob/devel/awx/main/utils/ansible.py#L20 to scan the lines to determine if it "could be a playbook"
That shouldn't make much difference because the playbooks are identical yet only the first two are detected
Hmm okay, so please check:
https://<YOUR AWX>/api/v2/projects/<PROJECT ID>/playbooks/
Create New Job Template
pageOkay after diving into the code I realize my problem
Apparently the project function skips any directory named roles
which is exactly where my playbooks were placed, and ignores any files under it
Thats why my playbooks did not show up, after renaming roles
to playbooks
it works perfectly
Please confirm the following
security@ansible.com
instead.)Bug Summary
Suppose I have this repo:
When creating a template, only playbook 1 and 2 will be available to choose. files more than one directories deep within the repo are not discovered, which is a shame for those using large repos.
AWX version
24.2
Select the relevant components
Installation method
kubernetes
Modifications
no
Ansible version
No response
Operating system
No response
Web browser
No response
Steps to reproduce
normal install using operator add a git based project with playbooks inside subdirectories
Expected results
I'd expect too be able to choose all playbooks in the repo
Actual results
I can only choose playbooks which are 0 or 1 subdirectories deep
Additional information
No response