--- - name: Check n8n directory exist ansible.builtin.file: path: n8n state: directory - name: Copy template conf ansible.builtin.template: backup: true src: "{{ item.src }}" dest: "n8n/{{ item.dest }}" loop: - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } register: n8n_copy_templates_results - name: Force update and restart container community.docker.docker_compose: project_src: n8n state: present pull: true restarted: true when: n8n_copy_templates_results.changed become: true - name: Update or start container community.docker.docker_compose: project_src: n8n state: present pull: true when: not n8n_copy_templates_results.changed become: true