Files
ansible-docker/roles/docker/tasks/main.yml
2025-04-04 19:22:20 +03:00

31 lines
792 B
YAML

---
- name: Ensure legacy apt repository not present
ansible.builtin.file:
path: /etc/apt/sources.list.d/docker.list
state: absent
- name: Add docker apt repository
ansible.builtin.deb822_repository:
name: docker
uris: https://download.docker.com/linux/{{ ansible_distribution | lower }}
signed_by: https://download.docker.com/linux/debian/gpg
suites: "{{ ansible_distribution_release }}"
# architectures: "{{ apt_arch }}"
components:
- stable
- name: Install docker
ansible.builtin.apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- python3-docker
- name: Ensure docker is started and enabled
ansible.builtin.systemd:
name: docker.service
state: started
enabled: true