0

I have a project git repository and a roles git repository both have branches with the same name, my project git repository has the requirements.yml similar to below

---
- src: <some_git_repo>
  scm: git
  version: master
  path: /var/lib/awx/projects/_7__roles
  force: yes
  ignore_errors: yes

The problem is awx will always checkout the master version with the above requirements.yml instead of my branch so i can never test my branch changes

I could change the version to be the branch name then commit it but then if i forget to change it back and merge my changes now the master project branch will be using my roles branch instead of the master copy

I've tried editing the requirements.yml version after awx has cloned it however it will then refuse to do a scm update due to the modification.

Does anybody know of a way that would allow me to use my own role branch on awx without breaking the master branch if it gets accidentally checked in?

Snipzwolf
  • 533
  • 1
  • 8
  • 22

1 Answers1

0

For anyone else who comes across the same problem in end i managed to workaround this by setting the projects in awx as manual then symlinking the directories into the correct places for my playbooks, below is an example of the tower-cli commands i used, also when setting up awx you need to have project_data_dir=/var/lib/awx/projects in your inventory otherwise the symlinks won't work in the awx containers.

git clone -b "mybranch" <role_repo_url> /var/lib/awx/projects/my_roles/;
ln -s /var/lib/awx/projects/my_roles/ /var/lib/awx/projects/_7__roles;
tower-cli project create --organization "my_org" -n "Roles" --local-path my_roles;

git clone -b "mybranch" <project_repo_url> /var/lib/awx/projects/my_project/;
ln -s /var/lib/awx/projects/my_project/ /var/lib/awx/projects/_6__projects;
tower-cli project create --organization "my_org" -n "Projects" --scm-type manual --local-path my_project;
Snipzwolf
  • 533
  • 1
  • 8
  • 22