--- - name: Check gitea directory exist ansible.builtin.file: path: gitea state: directory - name: Copy template conf ansible.builtin.template: src: "{{ item.src }}" dest: "gitea/{{ item.dest }}" loop: - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - { src: 'config.yml', dest: 'config.yml' } register: gitea_copy_templates_results - name: Update and restart container community.docker.docker_compose: project_src: gitea state: present pull: true restarted: "{{ gitea_copy_templates_results.changed }}" become: true