What is the difference between ansible playbook and roles?

+1 vote
What is the difference between ansible playbook and roles?
Jan 9, 2019 in Ansible by Alan
6,759 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 9, 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 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
1,520 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
• 51,970 points
599 views
0 votes
0 answers

what is the difference between tags and delegate_to in ansible?

Sep 23, 2019 in Ansible by Rajendra
• 480 points

closed Sep 24, 2019 by Kalgi 109 views
+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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
807 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
321 views