O'Reilly logo

Ansible Configuration Management by Daniel Hall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Roles

If your playbooks start expanding beyond what includes can help you solve, or you start gathering a large number of templates, you may want to use roles. Roles in Ansible allow you to group files together in a defined format. They are essentially an extension to includes that handles a few things automatically, and this helps you organize them inside your repository.

Roles allows you to place your variables, files, tasks, templates, and handlers in a folder, and then easily include them. You can also include other roles from within roles, which effectively creates a tree of dependencies. Similar to task includes, they can have variables passed to them. Using these features, you should be able to build self-contained roles that are easy to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required