role directory structure

The fixed set of folders inside a role, such as tasks, handlers, templates, files, defaults and vars, each holding one kind of content.

In more detail

Ansible finds each piece by its location: tasks/main.yml is the entry point, handlers/main.yml holds handlers, templates holds Jinja files, files holds files copied unchanged, defaults/main.yml holds overridable defaults and vars/main.yml holds tightly controlled role variables. A meta folder can list dependencies. Following the layout is what lets both Ansible and a reviewer find things.

Related terms

Taught in

References

Certification courses