Someone please help how to export project details with the branch names. We are using AWX.
Is it possible to do from Molecule server or from Ansible server ?
We tried some python scripts but so far it is only exporting project details, last run details etc.
What branch names are you looking for, it doesn’t store all of them, just the scm_branch or scm_refspec, that you’ve selected for the project, you can see it in api/v2/projects/ api endpoint. To export, easiest way is something like this
Thanks Sean.
We are basically looking for projects that are not using standard branch names like “awx-test”, “awx-syst” and “awx-prod”.
We want to list all the projects that are hosted in AWX with branch names so that we can reach out to project owners to use correct branch names as mentioned above.
The above should work then, you could then not put it in a file, but parse the data.
Another option is to use the awx.awx and the Ansible Galaxy collections, and the exported data from ALL, with that same module. Store them in Git, and then run a playbook on controller or a CI pipeline to make sure everything is set. Similar to what I did in this blog.
Several companies I know use this to prevent drift, make sure things like job templates are on the right playbook, workflows constructed correctly, inventories sources updated, and have PR approval over changes to the AWX configuration.