--- - name: Update Collabora (pull + recreate in same compose project) hosts: proxmox become: true vars: collabora_compose_path: /data/compose/nextcloud/collabora-only.yml collabora_project_name: nextcloud-collabora # based on your labels tasks: - name: Pull collabora/code:latest image community.docker.docker_image: name: collabora/code tag: latest source: pull # Compose file contains only service "collabora", so this acts on that service only - name: Compose pull (ensure freshest image) community.docker.docker_compose_v2: project_name: "{{ collabora_project_name }}" files: ["{{ collabora_compose_path }}"] pull: always state: present - name: Recreate collabora with new image community.docker.docker_compose_v2: project_name: "{{ collabora_project_name }}" files: ["{{ collabora_compose_path }}"] recreate: always state: present