awx icon indicating copy to clipboard operation
awx copied to clipboard

Expand COLLECTIONS_PATHS for repos that are a valid collection

Open azrdev opened this issue 1 year ago • 1 comments

Please confirm the following

  • [X] I agree to follow this project's code of conduct.
  • [X] I have checked the current issues for duplicates.
  • [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.

Feature type

New Feature

Feature Summary

When a repo (referenced by an AWX project) is itself a collection, it should be possible to reference e.g. its contained playbooks by fqcn (docs) instead of (relative) path, in import_playbook, and also in the Job Template Add/Edit GUI. The same is probably true for roles (and much more common). This currently does not work, because the project directory is not added to the ansible config value COLLECTIONS_PATHS.

Select the relevant components

  • [X] UI
  • [ ] API
  • [ ] Docs
  • [ ] Collection
  • [ ] CLI
  • [ ] Other

Steps to reproduce

  1. Create a collection example.test
  2. Create two playbooks in a directory playbooks/:
    # one.yml
    - import_playbook: example.test.two
    
    and two.yml
  3. Commit the (collection directory) to git, so that there is /path/to/ansible_collections/example/test/.git/
  4. Add the repo as a Project in AWX
  5. Try to create a JT from that Project with Playbook = example.test.one
  6. Create & Launch a JT from that Project with Playbook = playbooks/one.yml

Current results

  1. Cannot create a JT with a FQCN, only a path
  2. import_playbook cannot find two.yml by FQCN

Sugested feature result

I propose to add the project directory to the ansible config value COLLECTIONS_PATHS when a project is recognized to be a collection, e.g. when containing a galaxy.yml at the toplevel (with yaml keys matching the expected schema).

Additional information

Maybe split the GUI issue about JT.playbook ?

azrdev avatar Jun 27 '23 14:06 azrdev