Managing the container host
Various types of container software are available, such as Docker and Podman. In this chapter, we will be using Docker to explain and demonstrate container management using Ansible. We will be using Docker Community Edition (CE), which is free, though you can use Docker Enterprise Edition (EE) if needed.
Ansible Docker prerequisites
To use the Ansible Docker modules, you must install the docker
library, which you can do using Python pip
or standard packages managers such as yum
(yum install python-docker-py
) of dnf
if available. If you are using the old version of Python (2.6), then you should install and use the old library called docker-py
.
Installing Docker on the host using Ansible
Installing Docker software on a host involves multiple steps and configurations. These steps can be completed manually or we can use the Ansible role available in Ansible Galaxy. We will be using the community Ansible role called geerlingguy.docker
(https://github...