0
votes

My ansible roles are located in separate repositories in Github and are linked to the playbooks via the .gitmodules file.

If I now synchronize the repo as a project on the AWX (git clone) I don't get the current master branch state of the submodules, only the state of the commit-id.

In my opinion, after the project is synchronized (repo is cloned on the AWX) something like a 'git submodule foreach git pull origin master' should be made to get the master branch state for all submodules/roles.

Does anyone have any idea how I can get the latest master branch in submodules when creating or updating a project using AWX/Tower?

1

1 Answers

1
votes

Can't you use a galaxy requirements.yml to pull in these external roles? This is the preferred way of importing roles into a repository. https://galaxy.ansible.com/docs/using/installing.html

AWX is already configured to run ansible-galaxy install if it can find a roles/requirements.yml file https://docs.ansible.com/ansible-tower/latest/html/userguide/projects.html#ansible-galaxy-support