Creating new Playbooks and roles
This commit is contained in:
parent
6b0947193f
commit
51732b2cb7
15
Creating-new-playbook.md
Normal file
15
Creating-new-playbook.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#New playbook
|
||||||
|
|
||||||
|
##### Create new playbook only if you see there is an independent task that is need to be performed on node
|
||||||
|
|
||||||
|
**Content of playbook**
|
||||||
|
|
||||||
|
1. Host
|
||||||
|
Mention all nodes of which you want this playbook to run
|
||||||
|
2. Vars
|
||||||
|
If you want to use any variables in current playbook you may introduce them here
|
||||||
|
3. Tasks
|
||||||
|
Series of tasks can be provided but, it is recommended to add tasks in Roles and use those roles in current playbook
|
||||||
|
4. Roles
|
||||||
|
Roles are to be created when we have found a sub independent task and those roles can become part of playbook
|
||||||
|
|
17
Creating-new-role.md
Normal file
17
Creating-new-role.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#New Role
|
||||||
|
|
||||||
|
#### Once you are super sure you find a sub module and its independent you can create a Role for it that can be used in different playbooks
|
||||||
|
|
||||||
|
**Directory structure**
|
||||||
|
|
||||||
|
1. Defaults:-
|
||||||
|
Here we need to define all vars in ``main.yml`` that will be used later on in this role
|
||||||
|
2. Files:-
|
||||||
|
Here we put all those files which are related to role's business requirements, like we want to ran a docker container or setup a nginx server and all supporting files will be here
|
||||||
|
3. Tasks:-
|
||||||
|
All doable tasks will be here by default all tasks in ``main.yml`` are defined here
|
||||||
|
4. Templates:-
|
||||||
|
This is the directory which is responsible for generating files during run time, also behaves like a bridge.
|
||||||
|
5. .travis.yml:-
|
||||||
|
In this file we define all the dependencies of current role.
|
||||||
|
|
Loading…
Reference in a new issue