Files
homelab/ansible/preparing-playbook/reza-ansible/roles/docker/tasks/install_docker.yaml

42 lines
807 B
YAML

---
- name: install dependency
apt:
name: "{{item}}"
state: present
update_cache: yes
loop:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- name: give GPG key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
environment: "{{ proxy_env }}"
- name: add docker repo
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
environment: "{{ proxy_env }}"
- name: install docker
apt:
name: "{{item}}"
state: latest
update_cache: yes
loop:
- docker-ce
- docker-ce-cli
- containerd.io
environment: "{{ proxy_env }}"
- name: start and enable docker
service:
name: docker
state: started
enabled: yes