christianlempa-boilerplates/ansible/installation/inst-docker-ubuntu.yaml
Christoph Schug 49d4256a58 chore: consistently use Ansible FQCN in module calls
In order to adhere to Ansible best practices, always use Fully Qualified
Collection Names (FQCN) [1] when calling modules.

Other than that, this commit doesn't apply any further changes
except where needed as a module name has been updated.
The module `ansible.builtin.systemd` has been renamed to
`ansible.builtin.systemd_service` with `ansible.builtin.systemd` just
being an alias [2] for reasons of backward compatibility.

[1] https://docs.ansible.com/ansible/latest/tips_tricks/ansible_tips_tricks.html#use-fully-qualified-collection-names
[2] https://docs.ansible.com/ansible/latest/collections/ansible/builtin/systemd_service_module.html#synopsis
2024-02-24 11:56:25 +01:00

35 lines
1.0 KiB
YAML

---
- name: install docker
hosts: "{{ hosts }}"
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:
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