Ansible Role docker

This role installs and configures docker.

Mandatory Requirements

If you use the „docker“ Playbook, this is automatically done for you.

Tags

Tag

What it does

docker

Installs and configures docker

docker:state

Manages the state of the docker service

Optional Role Variables

Variable

Description

Default Value

docker__daemon_json_dns

A list of DNS server for all Docker containers.

The server’s nameserver

docker__daemon_json_insecure_registries

A list of insecure registries (without TLS) which should be accepted by the docker daemon.

unset

docker__daemon_json_log_driver

The default logging driver for all containers. Possible options: https://docs.docker.com/config/containers/logging/configure/.

'syslog'

docker__daemon_json_log_opts

A dictionary of logging options. Possible options: https://docs.docker.com/config/containers/logging/configure/.

unset

docker__service_enabled

Enables or disables the docker service, analogous to systemctl enable/disable.

true

docker__service_state

Changes the state of the docker service, analogous to systemctl start/stop/restart/reload. Possible options:
* started
* stopped
* restarted
* reloaded

'started'

Example:

# optional
docker__daemon_json_dns:
  - '{{ ansible_facts["dns"]["nameservers"][0] }}'
  - 'dns.example.com'
docker__daemon_json_insecure_registries:
  - 'registry.example.com:5000'
docker__daemon_json_log_driver: 'syslog'
docker__daemon_json_log_opts:
  env: 'os,customer'
  labels: 'somelabel'
  max-file: '5'
  max-size: '11m'
docker__service_enabled: true
docker__service_state: 'started'

License

The Unlicense

Author Information

Linuxfabrik GmbH, Zurich