diff options
Diffstat (limited to 'roles/services/containers/text_generation/handlers')
-rw-r--r-- | roles/services/containers/text_generation/handlers/main.yml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/services/containers/text_generation/handlers/main.yml b/roles/services/containers/text_generation/handlers/main.yml new file mode 100644 index 0000000..7aab823 --- /dev/null +++ b/roles/services/containers/text_generation/handlers/main.yml | |||
@@ -0,0 +1,29 @@ | |||
1 | - name: login to docker registry | ||
2 | become: yes | ||
3 | become_user: "{{ docker_username }}" | ||
4 | environment: | ||
5 | XDG_RUNTIME_DIR: "/run/user/{{ docker_uid }}" | ||
6 | docker_login: | ||
7 | docker_host: "unix://run/user/{{ docker_uid }}/docker.sock" | ||
8 | registry_url: "{{ docker_registry_url }}" | ||
9 | username: "{{ docker_registry_username }}" | ||
10 | password: "{{ docker_registry_password }}" | ||
11 | |||
12 | - name: build text-generation image | ||
13 | become: yes | ||
14 | become_user: "{{ docker_username }}" | ||
15 | environment: | ||
16 | XDG_RUNTIME_DIR: "/run/user/{{ docker_uid }}" | ||
17 | docker_image: | ||
18 | name: "{{ docker_registry_url }}/{{ docker_registry_username }}/text-generation:latest" | ||
19 | docker_host: "unix://run/user/{{ docker_uid }}/docker.sock" | ||
20 | build: | ||
21 | path: /srv/docker/text-generation/src | ||
22 | source: build | ||
23 | push: yes | ||
24 | force_source: yes | ||
25 | |||
26 | - name: restart nginx | ||
27 | service: | ||
28 | name: nginx | ||
29 | state: restarted | ||