54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
|
---
|
||
|
- name: Configure ntfy
|
||
|
copy:
|
||
|
content: "{{ ntfy_configuration | to_nice_yaml(indent=4, width=250) }}"
|
||
|
dest: /etc/ntfy/server.yml
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: '0664'
|
||
|
backup: yes
|
||
|
|
||
|
- name: Ensure cache file is accessible to ntfy
|
||
|
file:
|
||
|
path: "{{ cache_file }}"
|
||
|
owner: ntfy
|
||
|
group: ntfy
|
||
|
state: touch
|
||
|
mode: 0660
|
||
|
when: cache_file is defined
|
||
|
|
||
|
- name: Ensure auth file is accessible to ntfy
|
||
|
file:
|
||
|
path: "{{ auth_file }}"
|
||
|
owner: ntfy
|
||
|
group: ntfy
|
||
|
state: touch
|
||
|
mode: 0660
|
||
|
when: auth_file is defined
|
||
|
|
||
|
- name: Ensure attachments directory exists
|
||
|
file:
|
||
|
path: "{{ attachment_cache_dir }}"
|
||
|
owner: ntfy
|
||
|
group: ntfy
|
||
|
state: directory
|
||
|
mode: 0660
|
||
|
when: attachment_cache_dir is defined
|
||
|
|
||
|
- name: Ensure ntfy is enabled and started
|
||
|
systemd:
|
||
|
name: ntfy
|
||
|
state: started
|
||
|
enabled: true
|
||
|
|
||
|
# - name: Configure administrators
|
||
|
# shell: "ntfy user add --role=admin {{ item.name }}"
|
||
|
# loop: "{{ admin_accounts }}"
|
||
|
|
||
|
# - name: Configure users
|
||
|
# shell: "ntfy user add --role=user {{ item.name }}"
|
||
|
# loop: "{{ user_accounts }}"
|
||
|
|
||
|
# - name: Grant permissions
|
||
|
# shell: "ntfy access {{ item.username }} {{ item.topic }} {{ item.permission }}"
|
||
|
# loop: "{{ access_rules }}"
|