From the course: Learning Ansible

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Working with playbooks in Ansible

Working with playbooks in Ansible - Ansible Tutorial

From the course: Learning Ansible

Start my 1-month free trial

Working with playbooks in Ansible

- [Instructor] Sure ad hoc commands are very powerful with Ansible, allowing us to run commands against the systems of our choice, but let's face it, playbooks are where the power really comes into play. So let's turn to an editing software package like Atom, in order to create a playbook. This is how easy it is. Notice I've created a file called first.yml, and inside of the Atom editor, I begin my YAML file with the three dashes. This indicates that it is an Ansible syntax that we're going to be utilizing. Then I do a dash and I give a name for the first play of the playbook. So I'm going to do a name of my first play inside of this playbook. And then I'm going to come in and tab over just below the name, the tabs are extremely important in the YAML file, and I'm going to run this against the local host. So we specify the hosts that are going to have this play executed it against them. And then we skip a line and we…

Contents