--- - 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 - docker-compose state: present tags: ['docker'] - name: create docker-compose directory file: path: /opt/docker-compose state: directory mode: '0755' tags: ['docker'] - name: install Python module pip: name: - docker - docker-compose 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 - name: copy logrotate config copy: src: traefik/logrotate dest: /etc/logrotate.d/docker mode: '0644' force: yes