klips/ansible/roles/docker/tasks/docker-install.yml

28 lines
646 B
YAML
Raw Normal View History

2019-08-29 07:27:08 +00:00
---
- name: Remove any previous versions of Docker
package:
name:
- docker
- docker-engine
state: absent
- name: Add Docker gpg key to apt
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present
register: add_repository_key
- name: Add Docker repository to apt
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
state: present
update_cache: true
- name: Install Docker
package:
name: docker-ce
state: present
notify: restart docker