-
Notifications
You must be signed in to change notification settings - Fork 0
/
roles
52 lines (40 loc) · 926 Bytes
/
roles
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html
To generate a role
ansible-galaxy init <role name>
As noted in Creating Reusable Playbooks, include and import statements are very similar, however the Ansible executor engine treats them very differently.
• All import* statements are pre-processed at the time playbooks are parsed.
• All include* statements are processed as they are encountered during the execution of the playbook.
roleName/
|- defaults
|--- main.yml
|- files
|- handlers
|--- main.yml
|- meta
|--- main.yml
|- tasks
|--- main.yml
|- templates
|- tests
|--- inventory
|--- test.yml
|- vars
|--- main.yml
|- README.md
Example project structure
site.yml
webservers.yml
fooservers.yml
roles/
common/
tasks/
handlers/
files/
templates/
vars/
defaults/
meta/
webservers/
tasks/
defaults/
meta/