To reuse role in a playbook, there are 3 options:
roles
: at play level, statically, executed beforetasks
.include_role
: at task level, dynamically, parsed and executed at where it is defined.import_role
: at task level, statically, parsed before the calling play execution and if no syntax error executed at where it is defined.
Regarding statically
and dynamically
above, there is
explanation.
Example snippet for role reusing:
1 |
|