Creating new Playbooks and roles #1

Merged
Ghost merged 2 commits from docs/roles-playbooks into master 2020-07-16 06:14:28 +00:00
2 changed files with 32 additions and 0 deletions

15
Creating-new-playbook.md Normal file
View file

@ -0,0 +1,15 @@
#New playbook
##### Create new playbook only if you see there is an independent task that must be performed on node
Outdated
Review

Create new playbook only if you see there is an independent task that must be performed on node

Create new playbook only if you see there is an independent task that must 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
View 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.