This repository has been archived on 2024-05-16. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-role-docker/tasks/main.yml
2023-04-17 19:28:35 +02:00

36 lines
867 B
YAML

- name: Install prerequisites
apt:
pkg:
- ca-certificates
- curl
- gnupg
- lsb-release
- python3-pip
- name: Add APT key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
keyring: /etc/apt/keyrings/docker.gpg
- name: Add repository
apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
- name: Install Docker
apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose-plugin
- name: Install Python modules
pip:
name:
- docker
- docker-compose
- name: Copy daemon.json
copy:
dest: /etc/docker/daemon.json
content: "{{ docker_daemon_config | to_json }}"
- name: Start Docker
systemd:
name: docker
enabled: true
state: started