What is the difference between ansible playbook and roles

+1 vote
What is the difference between ansible playbook and roles?
Jan 10, 2019 in Ansible by Alan
21,820 views

2 answers to this question.

+2 votes

Ansible playbook is a script file which contains all the tasks that need to be performed along with all the ingredients required to perform these tasks.

Roles are ways of automatically certain var files, tasks, and handlers based on the known file structure. 

answered Jan 10, 2019 by Dora
+2 votes
Hi,

Roles:

Roles containing certain vars_files, tasks, and handlers based on which it had declared.

In general grouping of tasks or handlers will allow the sharing of roles.

Playbooks:

Playbooks are written in YAML format. YAML stands for Yet Another Markup Language.

Playbooks are one of the core features of Ansible and tell Ansible what to execute.

They are like a to-do list for Ansible that contains a list of tasks.
answered Jan 21, 2020 by vivek
• 530 points
Thanks. I have upvoted your answer.

Related Questions In Ansible

0 votes
1 answer

What is the difference between the host file and an inventory file in ansible?

Actually both are same. hosts file is ...READ MORE

answered Feb 12, 2019 in Ansible by Amith
• 140 points
8,002 views
0 votes
1 answer

what is the difference between tags and delegate_to in ansible?

Hey @Rajendra, If you wish to perform ...READ MORE

answered Sep 24, 2019 in Ansible by Kalgi
• 52,350 points
1,917 views
0 votes
0 answers

what is the difference between tags and delegate_to in ansible?

Sep 23, 2019 in Ansible by Rajendra
• 510 points

closed Sep 24, 2019 by Kalgi 820 views
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 views
+2 votes
1 answer
0 votes
1 answer

Error while running playbook consisting of roles - Ansible

You get this error because ansible was ...READ MORE

answered Mar 12, 2019 in Ansible by William
2,670 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP