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
2,944 views

2 answers to this question.

+1 vote

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
+1 vote
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
• 510 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
818 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,830 points
323 views
0 votes
0 answers

what is the difference between tags and delegate_to in ansible?

Sep 23, 2019 in Ansible by Rajendra
• 470 points

closed Sep 24, 2019 by Kalgi 61 views
+13 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,400 points
412 views
0 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
113 views