- Let's install the pip package docker-py in a version greater than 1.7.0. Ansible will use this Python library to interact with the Docker API:
$ pip install 'docker-py>=1.7.0'
- Let's install the docker-compose pip package in a version greater than 1.7.0. Ansible will use this to interact with Docker compose:
$ pip install 'docker-compose>=1.7.0'
- The Ansible module connects with the Docker API, as we mentioned earlier. Using parameters passed with tasks, we will be using a local Docker engine to create and manage Docker containers. It connects to a docker parameter using the parameter called docker_host. We can also set the environment variable to DOCKER_HOST.
We should note that the default host used by the Ansible module ...