The structure of the Ansible playbook

The structure of the Ansible role is very simple. In the earlier use case, we included everything in one single file named nginx.yml, but as the lines of code grow, this is not the best approach.

This is one of the reasons for which a structured approach is required:

In the preceding structure, we have a separate directory for inventory as well as roles.

Inside roles, there will be various kinds of roles such as nginx, server-hardening, and waf. This can be illustrated by the following diagram:

In the preceding ...

Get Enterprise Cloud Security and Governance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.