diff options
Diffstat (limited to 'ansible.html.markdown')
| -rw-r--r-- | ansible.html.markdown | 24 | 
1 files changed, 17 insertions, 7 deletions
diff --git a/ansible.html.markdown b/ansible.html.markdown index 2b997340..460faf82 100644 --- a/ansible.html.markdown +++ b/ansible.html.markdown @@ -139,20 +139,20 @@ You can run the playbook with the command:  ```bash  $ ansible-playbook path/name_of_the_playbook.yml  ``` -## More on ansible concept +### More on ansible concept -### ansible-roles (a 'template-playbooks in right structure') +#### ansible-roles (a 'template-playbooks' with right structure) -There are tasks (modules) that can be run via CLI +You already know the tasks (modules) that can be run via CLI  The execution plans of multiple tasks (with variables and logic) are called playbooks. -For parts of the code, that should be reusable, a concept called `role` was introduced +A concept called `role` was introduced for parts of the code that should be reusable. -Role is a structured way to keep your set of tasks, variables, handlers, default settings, and way more (meta, files, templates). -Role allows to reuse the same parts of code in multiple plybooks (you can parametrize this). +**Role** is a structured way to manage your set of tasks, variables, handlers, default settings, and way more (meta, files, templates). +Role allows to reuse the same parts of code in multiple plybooks (you can parametrize the role 'further' during it's execution).  It is a great way to introduce `object oriented` management for your applications. -Role can be included in your playbook (executed in your playbook). +Role can be included in your playbook (executed via your playbook).  ```yml @@ -173,6 +173,16 @@ pre_tasks:        shell: echo 'this task is the last, but would be executed before roles, and before tasks'  ``` +Example-role + +We would clone the ready-to-use examples from additional repository +```bash +$ git colone git@github.com:sirkubax/ansible-for-learnXinYminutes.git +$ cd ansible-for-learnXinYminutes +$ source environment +$(venv) ansible-playbook playbooks/role_example.yml +``` +  Role directory structure:  ```  roles/  | 
