jetune.docker

Ansible Role for Docker on Linux

Python Licence Travis Build Galaxy Role Downloads

This Ansible role installs Docker Engine and Docker Compose on Linux operating systems.

Supported Versions

Component Version
Docker Engine 18.03.1 and above
Docker Compose 1.23.0 and above

Supported Operating Systems

OS Distribution OS Version
CentOS 7 and above
Ubuntu Xenial, Bionic and above

Role Variables

Variable Description Default Value
install_community Set to true to install the Community version, false for Enterprise. true
docker_version Specify the Docker version to install. latest
docker_gpg_key GPG Key URL for Docker Repository (Ubuntu). https://download.docker.com/linux/ubuntu/gpg
docker_gpg_key_fingerprint GPG Key Fingerprint for Docker Repository (Ubuntu). 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
docker_repository_baseurl Docker Repository Base URL (Ubuntu). https://download.docker.com/linux/ubuntu
docker_repository_file Docker Repository File URL (CentOS). https://download.docker.com/linux/centos/docker-ce.repo
docker_packages List of Docker packages to install. [docker-ce, docker-ce-cli, containerd.io]
install_compose Set to true to install Docker Compose. true
compose_version Version of Docker Compose to install (if install_compose is true). -

See the next section for a complete list of variables.

Usage

  • To install the role, run: ansible-galaxy install jetune.docker
  • Include it in your playbook for installation from repository:
---
- name: Set up Docker
  hosts: all
  vars_files:
   - "test-vars-ce-{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"

  roles:
   - role: jetune.docker
  • Example playbook variables file for Ubuntu Bionic:
---

# Docker version
docker_version: "5:19.03.1~3-0~ubuntu-bionic"

# Install Docker community version
docker_install_community: true

# System architecture
docker_os_architecture: "{{ ansible_architecture | replace('amd64', 'x86_64') }}"

# Authorized Docker users
docker_authorized_users:
 - jetune
 - hmefoo
 - ltchatch

# Install Docker Compose
docker_install_compose: true

# Docker Compose version
docker_compose_version: "1.24.1"

# Docker Compose URL
docker_compose_url: "{{ 'https://github.com/docker/compose/releases/download/'\
+ docker_compose_version + '/docker-compose-' + ansible_system + '-' + docker_os_architecture }}"

# Docker Compose checksum
docker_compose_checksum: "sha256:cfb3439956216b1248308141f7193776fcf4b9c9b49cbbe2fb07885678e2bb8a"

# Docker data directory
docker_data_dir: "/kis/docker/datas"

# Docker security directory
docker_security_dir: "{{ docker_data_dir }}/security"

# Docker scripts directory
docker_scripts_dir: "{{ docker_data_dir }}/scripts"

# Script assets to upload (in the scripts directory)
docker_scripts_assets_dir: "scripts"

# Security assets to upload (in the security directory)
docker_security_assets_dir: "security"

# Docker host addresses
docker_hosts:
 - "0.0.0.0:2373"
 - "0.0.0.0:2374"
 - "0.0.0.0:2375"
 - "0.0.0.0:2376"

# Extra options for Docker
docker_extras_options:
 - "--log-level debug"
 - "--label TEST=true"
 - "--icc"
 - "--registry-mirror https://images.lab.kube-cloud.be"

# Docker role post-installation script (for tasks like installing plugins)
# This file will be located in the scripts directory "{{ docker_scripts_dir }}"
docker_post_install_script: "post-install.sh"

# Parameters for the post-install script
docker_post_install_script_parameters:
 - "param1"
 - "param2"
 - "param3"
 - "param4"
Installa
ansible-galaxy install jetune.docker
Licenza
apache-2.0
Download
790
Proprietario