791 B
791 B
#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
- Defaults:-
Here we need to define all vars in
main.yml
that will be used later on in this role - 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
- Tasks:-
All doable tasks will be here by default all tasks in
main.yml
are defined here - Templates:- This is the directory which is responsible for generating files during run time, also behaves like a bridge.
- .travis.yml:- In this file we define all the dependencies of current role.