/ansible-role-docker

Ansible role to install Docker on various Linux distributions

Apache License 2.0Apache-2.0

Ansible Role: Docker

Build Status Ansible Quality Score Ansible Role License

An Ansible role to install Docker (CE or EE) on various Linux distributions.

Requirements

Supported distributions

Distribution Version
CentOS 7
Debian Buster 10
Stretch 9 (stable)
Fedora 29
28
Ubuntu Disco 19.04
Cosmic 18.10
Bionic 18.04 (LTS)
Xenial 16.04 (LTS)

Installation

ansible-galaxy install erjac77.docker

Role Variables

# Flag to uninstall old versions of Docker
docker_uninstall_old_versions: false

# Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition)
docker_edition: ce
# Docker and containerd packages
docker_packages:
  - "docker-{{ docker_edition }}"
  - "docker-{{ docker_edition }}-cli"
  - containerd.io
# State can be one of: 'present' or 'latest'
docker_state: present

# List of users to be added to the docker group
docker_users:
  - "{{ lookup('env', 'USER') }}"

# Flag to configure Docker to start on boot
docker_start_on_boot: true

# Docker SDK for Python
docker_pip_dependencies:
  - python-setuptools
  - python-pip
docker_pip_packages:
  - docker

# Flag to install Docker Compose
docker_install_compose: true

Debian / Ubuntu

# Architecture can be one of: 'amd64', 'armhf', 'arm64', 'ppc64el' or 's390x'
docker_arch: amd64
# APT release channel can be one or many of: 'stable', 'nightly' or 'test'
docker_channels:
  - stable

Dependencies

None.

Example Playbook

- name: Install Docker
  hosts: all
  become: true

  roles:
    - erjac77.docker

License

Apache 2.0

Author Information

Eric Jacob (@erjac77)