This repository has been archived on 2023-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
max/roles/docker/tasks/main.yml

47 lines
1 KiB
YAML
Raw Normal View History

2022-12-03 12:05:55 +00:00
- name: Install Docker prerequisites
apt:
pkg:
- ca-certificates
- curl
- gnupg
- lsb-release
- python3-pip
- name: Add Docker APT key
apt_key:
2023-02-04 16:02:53 +00:00
url: https://download.docker.com/linux/debian/gpg
state: present
2022-12-03 12:05:55 +00:00
- name: Add Docker repository
apt_repository:
2023-02-04 16:02:53 +00:00
repo: "deb https://download.docker.com/linux/debian bullseye stable"
state: present
2022-12-20 16:02:09 +00:00
register: apt_repository
- name: Update APT cache
apt:
update_cache: true
when: apt_repository.changed
2022-12-03 12:05:55 +00:00
- name: Install Docker packages
apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose-plugin
- name: Install Docker modules for Python
pip:
name:
- docker
- docker-compose
2023-02-04 16:02:53 +00:00
- name: Create /etc/docker directory
file:
path: "/etc/docker"
state: directory
2023-01-18 22:50:54 +00:00
- name: Copy daemon.json
copy:
src: "{{ role_path }}/files/daemon.json"
dest: /etc/docker/daemon.json
2023-01-06 18:51:28 +00:00
- name: Start Docker
systemd:
name: docker
enabled: true
2023-01-07 12:15:47 +00:00
state: started