This Ansible role enables people to install the latest Docker on an Ubuntu-like system. It also provides a handy library function to validate that the Docker daemon is running and functional.
This role will only work on an Ubuntu-like system.
# Any additional docker service options
# Example: '--dns 8.8.8.8 --dns 8.8.4.4 --userns-remap=default'
# docker_additional_service_opts: |
# {
# "userns-remap": "default",
# "dns": [
# "8.8.8.8",
# "8.8.4.4"
# ]
# }
docker_additional_service_opts: |
{}
Install this module from Ansible Galaxy into the './roles' directory:
- name: artyom.docker_install
src: git+https://github.com/ProspePrim/docker_install.git
version: origin/master
Use it in a playbook as follows:
- hosts: all
roles:
- role: artyom.docker_install
tags: docker
become: true
vars:
docker_user: "artyomprima"
docker_additional_service_opts: |
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}