antmelekhin.docker

Docker

An Ansible role to install Docker Engine from the Docker repository and configure it.

Requirements

  • Supported version of Ansible: 2.12 and highter.
  • Supported platforms:
    • Debian
      • 10
      • 11
      • 12
    • Fedora
      • 39
      • 40
    • RHEL
      • 7
      • 8
      • 9
    • Ubuntu
      • 18.04
      • 20.04
      • 22.04

Role Variables

All variables that can be overridden are stored in the defaults/main.yml file. Please refer to the meta/argument_specs.yml file for a description of the available variables. Similarly, descriptions and defaults for preset variables can be found in the vars/main.yml file.

Dependencies

None.

Example Playbook

Install Docker Engine:

---
- name: 'Install Docker Engine'
  hosts: all

  roles:
    - role: antmelekhin.docker

Install Docker Engine and configure a DNS server for all Docker containers:

---
- name: 'Install Docker Engine'
  hosts: all

  roles:
    - role: antmelekhin.docker
      docker_daemon_options:
        dns:
          - '8.8.8.8'
        dns-search:
          - 'example.com'

Install Docker Engine v23.0.6:

---
- name: 'Install Docker Engine v23.0.6'
  hosts: all

  roles:
    - role: antmelekhin.docker
      docker_version: '5:23.0.6-1~ubuntu.22.04~jammy'
      when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('22.04', '=')

    - role: antmelekhin.docker
      docker_version: '23.0.6'
      when: ansible_os_family == 'RedHat'

License

MIT

Author Information

Melekhin Anton.

About

An Ansible role to install and configure Docker Engine.

Install
ansible-galaxy install antmelekhin.docker
GitHub repository
License
mit
Downloads
339