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

36 lines
884 B
YAML
Raw Normal View History

2023-04-17 17:28:35 +00:00
- name: Install prerequisites
apt:
pkg:
- ca-certificates
- curl
- lsb-release
- python3-pip
- name: Add APT key
apt_key:
2023-05-16 07:50:22 +00:00
url: https://download.docker.com/linux/debian/gpg
keyring: /etc/apt/trusted.gpg.d/docker.gpg
2023-04-17 17:28:35 +00:00
- name: Add repository
apt_repository:
2023-05-16 07:50:22 +00:00
repo: "deb [signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/{{ docker_repository }} {{ ansible_distribution_release }} stable"
2023-04-17 17:28:35 +00:00
- name: Install Docker
apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
2023-07-27 15:34:49 +00:00
# - docker-compose-plugin
2023-04-17 17:28:35 +00:00
- name: Install Python modules
pip:
name:
- docker
2023-07-27 15:34:49 +00:00
# - docker-compose
2023-04-17 17:28:35 +00:00
- 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