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.

Lesson 17 lab solution: Managing containers

Lesson 17 lab solution: Managing containers - Ansible Tutorial

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

Lesson 17 lab solution: Managing containers

So, what do we have? We have these playbooks. There is Docker main, okay? Let's move Docker main.yaml to runcontainer.yaml or move. Let's just copy it. Backward compatibility is always good. So run container and there we have a potman.yaml and I'm going to copy potman.yaml to potmanrh.yaml. I hope you see what is coming here. I want to do something creative here. So let me start with potmanrh.yaml where I am going to make sure that, well, the hosts is what we are going to do later, the collections, that is what we need. So I'm going to use include playbook, we haven't done that too often, but I'm going to use include playbook to make that a conditional playbook inclusion. So I am going to work with the run container. And in a run container, I'm using include playbook, botman rh.yaml. And when are we going to do that? Well, we are going to do that when Ansible facts. And then it's easy to make the mistake, it's not distribution family, it's OS family. eagles, rocky. Do we care about…

Contents