Problem Statement
Explain the role of templates and Jinja2 in Ansible.
Explanation
Templates in Ansible are files that use the Jinja2 templating engine to dynamically generate configuration files based on variables and logic.
They allow inserting variables, loops, and conditional statements into files before deployment. For example, you can use templates to create Nginx configuration files dynamically for different environments. This makes playbooks flexible and environment-aware while maintaining automation consistency.
