richardskumat.ansible_role_docker
Ansible Role for Docker
This role installs Docker CE on Debian versions 9 and 10. It also has a tasks file for Raspbian, but I have only tested it on Raspbian Stretch and Buster.
Requirements
This role has been tested with Ansible version greater than 2.9.
Role Variables
docker_service_state
: Defines whether the Docker service should be 'started' or not.docker_service_enabled
: Set to 'yes' to ensure the Docker service is enabled.
These values determine the state of the Docker service in the handlers/main.yml
file.
docker_centos_repo_baseurl
: URL to download the Docker repository file.configure_docker_users
: Set to 'false' by default. If you want to add or remove users from the Docker group, change this to 'true'. This will rundocker-users.yml
from the tasks.docker_group_name
: This is the name of the group that has write access to the Docker socket. The default name is 'docker'. For more information, refer to the Docker post-installation guide.add_docker_users
: List of users you want to add to the Docker group. The default is an empty list.Example:
add_docker_users: - john - wick
remove_docker_users
: List of users you want to remove from the Docker group. The default is an empty list.Example:
remove_docker_users: - john - wick
remove_docker_packages
: Set to 'false' by default. Change to 'true' if you want to uninstall Docker packages.
Dependencies
On Debian-based distributions, you need the lsb-release
package. This role will try to install it if it's not present.
Example Playbook
Here's a simple example of how to use this role in a playbook:
---
- name: Install Docker CE
hosts: all
become: 'true'
roles:
- role: richardskumat.ansible_role_docker
License
This role is licensed under GPLv3.
Author Information
This role was created by Richard Skumat.
ansible-galaxy install richardskumat.ansible_role_docker