ansible-role-docker/tasks/main.yml
2024-10-16 19:24:34 +00:00

31 lines
No EOL
650 B
YAML

- name: Ensure old versions of Docker are not installed.
package:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: absent
- include_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
- include_tasks: setup-Debian.yml
when: ansible_os_family == 'Debian'
- name: Install docker-ce packages.
package:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present
- name: restart docker
service:
name: docker
state: restarted
enabled: yes