- name: Install Docker become: true ansible.builtin.apt: install_recommends: false name: - docker.io - docker-compose policy_rc_d: 101 state: present notify: docker_restart - name: Configure Docker logging driver when: docker_logging_driver is defined and docker_logging_driver ansible.builtin.include_tasks: logging.yml - name: Restart systemd service if necessary ansible.builtin.meta: flush_handlers - name: Clean up Docker data become: true community.docker.docker_prune: containers: true images: true images_filters: dangling: false networks: true volumes: true builder_cache: true