Paul Brinkmeier 045506a9ab
All checks were successful
continuous-integration/drone/push Build is passing
Turn shell task into smaller Ansible tasks
2022-09-15 13:58:48 +02:00

49 lines
1.2 KiB
YAML

---
- name: Install Docker installation prerequisites
become: true
ansible.builtin.apt:
update_cache: true
# Don't upgrade, only make sure that the packages are present
# state: latest
name:
- ca-certificates
- curl
- gnupg
- lsb-release
- name: Retrieve Docker GPG key
ansible.builtin.uri:
url: https://download.docker.com/linux/debian/gpg
return_content: true
register: docker_gpg_key
- name: Install Docker GPG key
become: true
ansible.builtin.command: "gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"
args:
stdin: "{{ docker_gpg_key.content }}"
creates: /usr/share/keyrings/docker-archive-keyring.gpg
- name: Retrieve dpkg architecture
ansible.builtin.command: dpkg --print-architecture
register: dpkg_architecture
changed_when: false
- name: Add Docker apt repository
become: true
ansible.builtin.template:
src: docker.list.j2
dest: /etc/apt/sources.list.d/docker.list
mode: 0644
- name: Install Docker
become: true
ansible.builtin.apt:
update_cache: true
# Don't upgrade, only make sure that the packages are present
# state: latest
name:
- docker-ce
- docker-ce-cli
- containerd.io