Ansible Roles is basically another level of abstraction used to organize
playbooks.
They provide a skeleton for an independent
and reusable collection of variables, tasks, templates, files, and modules
which can be automatically loaded into the playbook.
Playbooks are a collection of roles. Every role has specific functionality.
Let’s understand the difference between Ansible roles and playbook with
an example.
Suppose you want your playbook to perform 10 different tasks
on 5 different systems, would you use a single playbook for this?
No, using a single playbook can make it confusing and prone to blunders.
Instead, you can create 10 different roles, where each role
will perform one task.
Then, all you need to do is, mention the name
of the role inside the playbook to call them.