From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Using playbooks to manage Docker

Using playbooks to manage Docker - Ansible Tutorial

From the course: Ansible: From Basics to Guru by Pearson

Using playbooks to manage Docker

So, let's have a look at the playbook that we are using to install Docker. I need to start with the inventory file. In the inventory file, I am going to work on Docker Buntu, that's the name of the machine. So you can probably guess which distribution is behind it. So the main playbook that we are going to look at is docker main and docker main.yaml. In docker main.yaml, I'm using a couple of constructions that I wanted to talk about as well. Hey, not all of the playbooks I'm using are perfect, and this is one example. So I got stuck in the middle of development, so set up Docker on CentOS 7. No, that should be set up Docker. And it's running on hosts all. And then it is importing test docker-centos.yaml, and it's importing test docker-ubuntu.yaml. And then there's a when statement. Now what is the thing that really doesn't work out well here? Well, if you use a when statement, you shouldn't use import, you should use include. This doesn't mean that it doesn't work, but it makes no…

Contents