4
votes

I have my directory structure setup such that the playbooks directory is under /var/lib/awx/projects/ and roles is a symlink under playbooks.

I need symlinks for roles as I'm using git push from my local system to push playbooks/roles to Tower and both playbooks and roles are under a different git repo.

When I try to run a job in Tower, it complains that it can't find my roles. When I look at every path that ansible states that it has looked in, they are there.

Any ideas why my roles can't be found?

1

1 Answers

2
votes

If the symlinks indeed are the problem (I can't tell) then git submodules might be a solution for you. You could add your "roles" repository as a submodule to the repository where the playbooks are located. You need to clone the parent repository then recursive:

git clone --recursive playbooks

Be aware submodules can be a huge PITA, but if you are required to have playbooks and roles in separate repositories and symlinks are indeed not followed by tower, this might be a solution.


Another solution would be to create a separate git repository for every role. Then you could install each role separately via ansible-galaxy. For that you need a requirements.yml with all your roles defined like this:

 - src: https://gitsource.host/user/some_role
   version: master
   name: some_role

Ansible Tower would install all listed roles automatically, as described here.