2022-08-05 20:59:55 +02:00
|
|
|
---
|
|
|
|
- name: add official GPG key
|
|
|
|
apt_key:
|
|
|
|
url: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg
|
|
|
|
state: present
|
|
|
|
tags: ['docker']
|
|
|
|
|
|
|
|
- name: add repository
|
|
|
|
apt_repository:
|
|
|
|
repo: "deb https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
|
|
|
|
state: present
|
|
|
|
tags: ['docker']
|
|
|
|
|
|
|
|
- name: install packages
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- docker-ce
|
|
|
|
- docker-ce-cli
|
2023-09-15 11:27:20 +02:00
|
|
|
- containerd.io
|
|
|
|
- docker-buildx-plugin
|
2022-08-05 20:59:55 +02:00
|
|
|
state: present
|
|
|
|
tags: ['docker']
|
|
|
|
|
|
|
|
- name: create docker-compose directory
|
|
|
|
file:
|
|
|
|
path: /opt/docker-compose
|
|
|
|
state: directory
|
|
|
|
mode: '0755'
|
|
|
|
tags: ['docker']
|
|
|
|
|
|
|
|
- name: ensure Docker is started and enabled at boot
|
|
|
|
service:
|
|
|
|
name: docker
|
|
|
|
state: started
|
|
|
|
enabled: true
|
|
|
|
tags: ['docker']
|
|
|
|
|
|
|
|
- name: copy rsyslog config
|
|
|
|
copy:
|
|
|
|
src: traefik/rsyslog
|
|
|
|
dest: /etc/rsyslog.d/10-docker.conf
|
|
|
|
mode: '0644'
|
|
|
|
force: yes
|
2022-10-03 15:55:10 +02:00
|
|
|
when: rsyslog_docker is defined
|
2022-08-05 20:59:55 +02:00
|
|
|
|
|
|
|
- name: copy logrotate config
|
|
|
|
copy:
|
|
|
|
src: traefik/logrotate
|
|
|
|
dest: /etc/logrotate.d/docker
|
|
|
|
mode: '0644'
|
|
|
|
force: yes
|
2023-09-15 11:27:20 +02:00
|
|
|
when: logrotate_docker is defined
|