caermeglaeddyv.ansible_role_docker
Ansible Role: Docker
This role is part of the container_runtime and is used to install and set up Docker.
Currently, it does the following:
- Adds the Docker Community Edition (docker-ce) repository
- Installs Docker and containerd
- Configures the Docker daemon to meet Kubernetes pre-install requirements
Requirements
These are not strict requirements, and it may not work with versions other than those tested. Feel free to test it yourself, suggest new features, and contribute.
This role has been tested with:
- Ansible version 2.8.6 or higher
- CentOS version 7.6 or higher
Role Variables
Here are the variables and their descriptions from defaults/main.yml:
# Version of Docker Community Edition to install:
docker_ce_version: 18.06.2.ce
# Version of containerd package to install:
docker_containerd_version: 1.2.10
Dependencies
None
Example Playbook
---
- hosts: localhost
gather_facts: false
become: no
tasks:
- name: Check if Ansible version is >= 2.8.6
assert:
msg: Ansible must be version 2.8.6 or higher
that:
- ansible_version.string is version("2.8.6", ">=")
tags:
- check
vars:
ansible_connection: local
- hosts: all
become: yes
tasks:
# Use the parent role when "container_runtime_name: docker" is set in your variables:
- import_role:
name: caermeglaeddyv.ansible_role_container_runtime
# Or directly:
- import_role:
name: caermeglaeddyv.ansible_role_docker
You can find more detailed examples (inventories, playbooks, etc.) for this and other roles here.
It is highly recommended to start your test deployments from there, especially if you use Google Cloud Platform or VMware vCenter as your infrastructure. The repository contains Packer and Terraform examples for building templates and deploying machines on these platforms.
License
Author Information
Copyright 2020 caermeglaeddyv
Linux / Kubernetes Administrator
ansible-galaxy install caermeglaeddyv.ansible_role_docker