Ansible role to install and configure Docker container engine on RHEL/CentOS 7.
Main features:
- Supports
overlay2
anddevicemapper
(with direct LVM) Docker storage drivers. - Uses
container-storage-setup
(also known asdocker-storage-setup
) to set up Docker's storage. - Prevents users from running
devicemapper
driver on a loopback device by default. - Sets up convenient passwordless sudo access for running Docker for selected users as recommended by Dan Walsh, lead of Red Hat's Docker team.
- Supports authenticating with private Docker registries.
Limitations:
- Automatically applying changes to the Docker storage configuration for an
existing system is not supported. You will have to manually remove the
contents of the
/var/lib/docker
directory and then run the role again.
This role requires Ansible 2.4 or higher.
It also requires RHEL/CentOS 7.4 or higher since OverlayFS support for SELinux has been added in that version.
Name | Type | Description |
---|---|---|
docker_storage_driver |
string | Storage driver to be used with Docker. It can be one of the following:
NOTE: The |
docker_storage_volumegroup |
string | Name of the LVM volume group to use for Docker storage. NOTE: If the value is NOTE: This variable must be changed
from the default value if the
|
docker_sudo_users |
list | List of users for which to configure passwordless sudo access for running Docker of the form: name: string
test (optional): boolean where |
docker_private_registries |
list | List of private Docker registries with which to authenticate the current system user of the form: registry_url: string
username: string
password: string
email: string where NOTE: |
None.
- hosts: all
vars:
docker_storage_volumegroup: dockervg
docker_sudo_users:
- alice
- bob
roles:
- docker
GPLv3
Tadej Janež
This Ansible role was originally developed for Genialis. With approval from Genialis, the code was generalised and published as Open Source, for which the author would like to express his gratitude.