--- - 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 - containerd.io - docker-buildx-plugin - docker-compose-plugin 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 when: rsyslog_docker is defined - name: copy logrotate config copy: src: traefik/logrotate dest: /etc/logrotate.d/docker mode: '0644' force: yes when: logrotate_docker is defined