Reusing Playbooks
- Creating Reusable playbooks is inevitable. In ansible we have two options for reusing playbooks
- Including and importing
- Roles
Including and Importing
- These allow users to break up larger playbooks into smaller files, which can be used across multiple parent playbooks or even multiple times within the same playbooks
- Dynamic vs static:
- Ansible has two modes of operation for reusable content dynamic and static
- If you use include* it will be dynamic
- If you use import* it will be static
- We can import/include playbooks, task files & roles
- Refer Here for the correct implementation
- Refer Here for tasks reusability