General best practices regarding roles

19 views
Skip to first unread message

John Harmon

unread,
Jan 2, 2019, 1:51:35 PM1/2/19
to Ansible Project
When setting up roles I have the following:
/etc/ansible/roles # tree aliases/ -L 1
aliases
/
├── defaults
├── handlers
├── main.yml
├── meta
├── README.md
├── tasks
├── tests
└── vars

The main.yml has the following content:
---
- hosts: "{{ host }}"
  gather_facts
: no

  roles
:
   
- aliases

This has worked fine for me up to this point, however, ansible TOWER excludes the roles, tasks, and hidden files/dirs from import.... meaning, that in order to utilize roles within tower I have to create a playbook outside of the roles directory to call it (ie /etc/ansible/call_my_role.yml

This makes me wonder what best practices are regarding roles and calling them.  I don't want to do it as described in the previous line but don't know if I have an option.  Thoughts?  I haven't seen much in the docs.

John Harmon

unread,
Jan 2, 2019, 3:37:06 PM1/2/19
to Ansible Project
I ended up renaming roles to role, then symlinking roles to role.  It now imports them fine and I don't have to change my current way of doing things.
Reply all
Reply to author
Forward
0 new messages