Open SJay3 opened 1 year ago
Hi @SJay3,
Thank you for opening this issue and being part of our community!
Is there any reason why you can't use the Galaxy credential types inside of AWX? They are designed to do specifically what you are after.
Hi @akus062381, No, we use Galaxy credentials in AWX. It works fine, but my question is about named galaxy credentials. If we create requirements.yml with source field it works in ansible directly, but didn't work in AWX. It happens because AWX set ansible environments as "server0,server1" instead of use named credentials, ex. "local,global"
Please confirm the following
Bug Summary
Unable to use named galaxy servers in awx.
Now, if you have more than one galaxy servers in awx, when project sync job is running it gets the following environment variables: ANSIBLE_GALAXY_SERVER_LIST="server0,server1" ANSIBLE_GALAXY_SERVER_SERVER0_URL="url" ANSIBLE_GALAXY_SERVER_SERVER0_TOEKN="token" ANSIBLE_GALAXY_SERVER_SERVER1_URL="url2" ANSIBLE_GALAXY_SERVER_SERVER2_TOKEN-"token2"
We need to support named galaxy servers in awx. It means that awx should set the following environment variables ANSIBLE_GALAXY_SERVER_LIST="MyLocalCoolServer,Global_server" ANSIBLE_GALAXY_SERVER_MYLOCALCOOLSERVER_URL="..." ANSIBLE_GALAXY_SERVER_GLOCAL_SERVER_URL="..."
AWX version
19.5.0
Select the relevant components
Installation method
kubernetes
Modifications
no
Ansible version
No response
Operating system
No response
Web browser
No response
Steps to reproduce
ansible.cfg
requirements.yml
When you manual run
ansible-galaxy collections install -r requirements.yml
everything works fine.Setup this galaxy servers in awx as global and local, add galaxy servers to organization, then sync project.
Expected results
In project sync job we have envs: ANSIBLE_GALAXY_SERVER_LIST="local,global" ANSIBLE_GALAXY_SERVER_LOCAL_URL="..." ANSIBLE_GALAXY_SERVER_GLOBAL_URL="..."
Actual results
ANSIBLE_GALAXY_SERVER_LIST="server0,server1" ANSIBLE_GALAXY_SERVER_SERVER0_URL="url" ANSIBLE_GALAXY_SERVER_SERVER0_TOEKN="token" ANSIBLE_GALAXY_SERVER_SERVER1_URL="url2" ANSIBLE_GALAXY_SERVER_SERVER2_TOKEN-"token2"
Additional information
Problem in this code https://github.com/ansible/awx/blob/devel/awx/main/tasks/jobs.py#L1154
when we build env variables for galaxy, we do not use name of galaxy credentials. I thing we could use credentials name. It looks like easy to fix