Ansible.Turn/roles/dockerhost/tasks/main.yml
Danny Bessems c8ec968ab6
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Add dependency
2022-10-15 17:24:02 +02:00

55 lines
1.2 KiB
YAML

- name: Remove undesired packages
apt:
name:
- containerd
- docker
- docker-engine
- docker.io
- runc
- snapd
state: absent
autoremove: yes
purge: yes
- name: Install prereqs for custom apt repository over https
apt:
update_cache: yes
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
state: present
- name: Add Docker repo key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present
- name: Determine Ubuntu distribution name
command: lsb_release -cs
register: releasename
- name: Add Docker apt repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ releasename.stdout }} stable
state: present
- name: Install Docker engine
apt:
update_cache: yes
allow_unauthenticated: yes
name:
- docker-ce
- docker-ce-cli
- docker-compose-plugin
- containerd.io
- name: Install Python Docker module
ansible.builtin.pip:
name: docker
executable: pip3
state: latest