-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotify.yml
46 lines (40 loc) · 1.42 KB
/
notify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- name: Create notify volume
community.docker.docker_volume:
name: "{{ notify['data_volume'] }}"
- name: Create ntfy container
community.docker.docker_container:
name: "{{ notify['container_name'] }}"
image: "{{ notify['container_image'] }}"
hostname: "{{ notify['container_hostname'] }}"
restart_policy: unless-stopped
recreate: true
env:
TZ: Europe/Bucharest
NTFY_BASE_URL: "https://{{ notify['domain'] }}"
NTFY_CACHE_FILE: "/var/lib/ntfy/cache.db"
NTFY_AUTH_FILE: "/var/lib/ntfy/auth.db"
NTFY_AUTH_DEFAULT_ACCESS: "deny-all"
NTFY_BEHIND_PROXY: "true"
NTFY_ATTACHMENT_CACHE_DIR: "/var/lib/ntfy/attachments"
NTFY_UPSTREAM_BASE_URL: https://ntfy.sh # this is for iOS phones
NTFY_ENABLE_LOGIN: "true"
# NTFY_WEB_ROOT: disable
ports:
- "2586:80"
networks:
- name: "{{ notify['network'] }}"
volumes:
- "{{ notify['data_volume'] }}:/var/lib/ntfy"
command: serve
- name: Check if admin user exists
community.docker.docker_container_exec:
container: "{{ notify['container_name'] }}"
command: ntfy user list
register: admin_user
- name: Create admin user
community.docker.docker_container_exec:
container: "{{ notify['container_name'] }}"
command: ntfy user add --role=admin {{ notify_admin_user }}
env:
NTFY_PASSWORD: "{{ notify_admin_pass }}"
when: admin_user.stderr_lines is not search("admin")