--- - name: Create directories file: path: "{{ item }}" state: directory with_items: - "/data/gotify" - "/data/gotify/data" - name: Pull docker image community.docker.docker_image: image: mgotify/server tag: 2.7.3 source: pull register: docker_image - name: Create the gotify container docker_container: name: gotify image: "{{ docker_image.image.RepoTags[0] }}" restart_policy: unless-stopped networks: - name: proxy volumes: - /data/gotify/data:/app/data labels: traefik.enable: "true" traefik.http.routers.gotify.rule: "Host(`gotify.comprofix.com`)" traefik.http.routers.gotify.entrypoints: "https" traefik.http.routers.gotify.tls: "true" traefik.http.routers.gotify.service: "gotify" traefik.http.services.gotify.loadbalancer.server.port: "80" when: docker_image.changed register: container_gotify