docker
Ansible Role: docker
An Ansible role installing Docker Engine and Docker Compose on Linux (Debian/Ubuntu).
Requirements
None.
Role Variables
Docker Daemon Configuration
The Docker daemon configuration file (/etc/docker/daemon.json
) content may be
set explicitly with docker_config
variable:
docker_config:
userns-remap: default
insecure-registries:
- registry.example.com:5000
The default configuration file content is following:
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
community.docker Modules Dependencies
Dependencies of community.docker modules are installed by default.
Set docker_ansible_dependencies_install
to no
to disable installation.
Checking of Iptables Rules Managed by Docker
The role checks iptables rules added by Docker. If they are absent Docker daemon
is restarted. To disable this behaviour set docker_iptables_check
variable
to no
.
Dependencies
None.
Example Playbook
Default setup:
---
- name: "example #1"
hosts: server
tasks:
- name: install Docker
ansible.builtin.import_role:
name: yabusygin.docker
Customized setup:
---
- name: "example #2"
hosts: server
tasks:
- name: install Docker
ansible.builtin.import_role:
name: yabusygin.docker
vars:
docker_config:
userns-remap: default
log-driver: json-file
log-opts:
max-size: 10m
max-file: "3"
insecure-registries:
- registry.example.com:5000
docker_ansible_dependencies_install: no
License
MIT
Author Information
Alexey Busygin <yaabusygin@gmail.com>
About
An Ansible role installing Docker Engine and Docker Compose.
Install
ansible-galaxy install yabusygin/ansible-role-docker
License
mit
Downloads
12863
Owner