forked from discover-devops/my_ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnsible Roles.YAML
28 lines (15 loc) · 1.15 KB
/
Ansible Roles.YAML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
In Ansible, the role is the primary mechanism for breaking a playbook into multiple files.
This simplifies writing complex playbooks, and it makes them easier to reuse.
The breaking of playbook allows you to logically break the playbook into reusable components.
Each role is basically limited to a particular functionality or desired output, with all the necessary
steps to provide that result either within that role itself or in other roles listed as dependencies.
Roles are not playbooks. Roles are small functionality which can be independently used but have to be used within
playbooks. There is no way to directly execute a role. Roles have no explicit setting for which host the role will apply
to.
Top-level playbooks are the bridge holding the hosts from your inventory file to roles that should be applied to those
hosts.
So, basically Roles let you automatically load related vars, files, tasks, handlers, and other Ansible artifacts based on a known file structure.
After you group your content in roles, you can easily reuse them and share them with other users.
Roles = Make your work re-usable
https://galaxy.ansible.com/
===============