Introduction to Ansible Transcripts
Chapter: Ansible Core Concepts
Lecture: Playbooks

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Playbooks are the highest level concept in Ansible
0:02 and playbook is likely the most frequent term
0:04 that you will hear used when people
0:07 are talking about Ansible.
0:08 Playbooks are the top level collection
0:09 and every playbook contains one or more roles
0:11 typically many tasks within those roles
0:13 associated variables and all the other
0:16 information necessary for execution
0:18 such as which servers are we going to execute
0:20 this playbook against.
0:22 Playbooks are run by using the ansible-playbook command.
0:25 Just as we had roles to group related tasks
0:28 together to accomplish various actions
0:30 we also needed a way to organize and group
0:33 the tasks, roles and variables.
0:34 And that is what a playbook is.
0:36 A simplified example of a playbook
0:38 would look like this, with the following
0:39 file names and directory structures.
0:41 As we saw in the roles video
0:43 in this case we have two roles
0:45 common and webserver.
0:46 We also have a couple of new files.
0:48 The first one, deployment.yaml
0:50 is the playbook instruction file
0:51 we'll reference when we use the Ansible playbook command.
0:54 Deployment.yaml would contain references
0:57 to the groups of servers that we'll run our roles on.
1:00 So deployment.yaml contains the bridge
1:02 between our roles and the servers that we want
1:05 Ansible to manage or handle a deployment on.
1:07 There's also a hosts file.
1:09 The hosts file contains the list of servers
1:10 that we want to execute our playbook against.
1:13 Hosts is also known as the inventory file
1:16 which we'll discuss next.