--- - name: Validate inputs ansible.builtin.import_tasks: validate.yml when: not (docker_remove | default(false) | bool) tags: always - name: Remove Docker (explicit only) ansible.builtin.include_tasks: remove.yml when: docker_remove | default(false) | bool tags: [docker, remove] - name: Write the daemon settings ansible.builtin.include_tasks: daemon.yml when: not (docker_remove | default(false) | bool) tags: [docker, configure] - name: Install Docker Engine ansible.builtin.include_tasks: install.yml when: not (docker_remove | default(false) | bool) tags: [docker, install] - name: Ensure Docker Engine is up-to-date ansible.builtin.include_tasks: update.yml when: - not (docker_remove | default(false) | bool) - docker_update | bool # Under --check a new source line is only simulated, so no package would have a candidate. - not ansible_check_mode or __docker_apt_source | default({}) is not changed tags: [docker, update] - name: Add configured users to the docker group become: true ansible.builtin.user: name: "{{ item }}" groups: "{{ docker_group }}" append: true loop: "{{ docker_users }}" when: - not (docker_remove | default(false) | bool) # Under --check on a host without the packages the group does not exist yet. - not ansible_check_mode or (__docker_apt_source | default({}) is not changed and __docker_packages | default({}) is not changed) tags: [docker, configure] - name: Install or remove the boot and shutdown units ansible.builtin.include_tasks: units.yml when: not (docker_remove | default(false) | bool) tags: [docker, configure] - name: Flush handlers ansible.builtin.meta: flush_handlers