We have two SCM repos for our Ansible code-base (1)Core and (2)Platform. The Core SCM contains application specific playbooks (ex: nginx, fluentd etc) while the Platform SCM contains basic platform specific roles (ex: ntp, apt etc). Our entry-point is a playbook from within Core. The Core playbook would then first include ‘roles’ from within the Platform SCM (to build the server/OS to a specific standard) and then do the app config. Our directory structure on an ‘Ansible’ workstation is as below
----- Core
— Nginx
— templates
— meta
— tasks
— defaults
— nginx.yml
— Fluentd
— templates
— meta
— tasks
— defaults
— fluentd.yml
— Platform → …/Platform
— ansible.cfg
----- Platform
— ntp
— sysstat
— sudo
— platform
— server
— meta
– main.yml
As you can see we symlink Platform → Platform within core.
A sample playbook(fluentd.yml) from within Core would look like
- name: fluentd
hosts: fluentd-server-nodes
sudo: true
vars:
x:y
p:q
roles:
-
role: Platform/platform/server
-
role: Fluentd
Also, we have ansible.cfg that sets the roles_path = .
under Core. This way when we run play from the Ansible Workstation, it is able to find the roles both in Core and Platform.
Not sure how we achieve this in Tower ?
We can’t seem to see how we can checkout an SCM under a specific location (we can change the base path but not the end checkout path).
Also does Tower support ansible.cfg ?
Thanks.