Roles
The default location for roles is /etc/ansible/roles
Roles provide a way to automatically load certain vars_files, tasks and handlers based on a known file structure
Roles expect a particular directory structure
Directories not being used may be excluded
Each directory in use contains a main.yml with relevant content
Roles Directories
Tasks – Contains the main list of tasks to be executed by this role.
Handlers – This directory contains handlers which may be used by this role or even anywhere outside this role
Defaults – This directory contains default variables for the role and is meant to provide a value to a variable if no other value is given (low precedence)
Vars – This directory contains variables used within the role (high precedence)
Files – This directory contains files which can be deployed via this role
Templates – This directory contains templates which can be deployed via this role
Meta – This directory defines some of the meta data for this role
RHEL System Roles
Provided by the RHEL Extras Repository
Requires the rhel-system-roles package to be installed
Can be used by Ansible Engine and Ansible Tower to manage RHEL systems
Needs to be installed on the Ansible control nodes which can be then used to manage and configure the client nodes
Supported system roles include: kdump, network, selinux, timesync and postfix (tech preview)
The documentation can be found /usr/share/doc/rhel-system-roles-<version>/SUBSYSTEM/
The Ansible roles may be found in the following location – /usr/share/ansible/roles/rhel-system-roles.SUBSYSTEM/