ansible/roles/docker-cluster/tasks/install-docker-ce.yml

38 lines
810 B
YAML
Raw Normal View History

2020-05-25 22:08:01 +00:00
---
- become: yes
block:
- name: install needed packages
apt:
update_cache: yes
pkg:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- name: add docker gpg key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: add docker repo
apt_repository:
2020-05-25 22:41:10 +00:00
repo: deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
2020-05-25 22:08:01 +00:00
state: present
filename: docker
- name: install docker
apt:
update_cache: yes
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- name: add current user to docker group
user:
name: "{{ansible_user_id}}"
groups: docker
append: yes