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