ansible-role-docker
This role installs docker-ce (Docker Community Edition) on a Debian system. (Tested on Stretch and Buster) It also exposes the Docker socket over TCP on port 2376, using X509 TLS certificates to enable / disable access.
Prerequisites
Ensure that the fqdn (hostname -f) of the host is resolvable through dns.
Example playbook
---
- hosts:
- hostname
roles:
- role: docker
Copy TLS certificates
Copy /root/.docker/ to your local home directory.
Remotely connect to your docker host
echo 'export DOCKER_HOST=tcp://<hostname>:2376
export DOCKER_CERT_PATH=~/.docker/<hostname>
export DOCKER_TLS_VERIFY=1' > vars
source vars
docker info
Languages
Jinja
100%