- name: login to docker registry become: yes become_user: "{{ docker_username }}" environment: XDG_RUNTIME_DIR: "/run/user/{{ docker_uid }}" docker_login: docker_host: "unix://run/user/{{ docker_uid }}/docker.sock" registry_url: "{{ docker_registry_url }}" username: "{{ docker_registry_username }}" password: "{{ docker_registry_password }}" - name: build text-generation image become: yes become_user: "{{ docker_username }}" environment: XDG_RUNTIME_DIR: "/run/user/{{ docker_uid }}" docker_image: name: "{{ docker_registry_url }}/{{ docker_registry_username }}/text-generation:latest" docker_host: "unix://run/user/{{ docker_uid }}/docker.sock" build: path: /srv/docker/text-generation/src source: build push: yes force_source: yes - name: restart nginx service: name: nginx state: restarted