christianlempa-boilerplates/ansible/installation/inst-docker-ubuntu.yaml

35 lines
1.0 KiB
YAML
Raw Normal View History

---
- name: install docker
hosts: "{{ my_hosts | d([]) }}"
become: yes
tasks:
- name: install docker dependencies
ansible.builtin.apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
update_cache: yes
- name: add docker gpg key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
keyring: /etc/apt/keyrings/docker.gpg
- name: add docker repository
ansible.builtin.apt_repository:
2024-03-03 15:59:49 +01:00
filename: docker
repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename|lower }} stable
state: present
- name: install docker engine
ansible.builtin.apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-scan-plugin
- docker-compose-plugin
update_cache: yes