uberspace-ansible/roles/nextcloud/tasks/apps.yml

45 lines
1.4 KiB
YAML
Raw Normal View History

2021-11-02 21:48:41 +01:00
---
- name: install notify_push
2021-11-06 16:14:55 +01:00
when: installation.changed
2021-11-02 21:48:41 +01:00
block:
- name: install app
2021-11-06 16:14:55 +01:00
command:
2021-11-02 21:48:41 +01:00
chdir: ~/html
cmd: php occ app:install notify_push
2021-11-06 16:14:55 +01:00
creates: ~/html/apps/notify_push
2021-11-02 21:48:41 +01:00
- name: set permissions
2021-11-06 16:14:55 +01:00
file:
path: ~/html/apps/notify_push/bin/x86_64/notify_push
2021-11-02 21:48:41 +01:00
mode: 0744
- name: create symlink
2021-11-06 16:14:55 +01:00
file:
2021-11-02 21:48:41 +01:00
path: ~/bin/notify_push
2021-11-06 16:14:55 +01:00
src: ~/html/apps/notify_push/bin/x86_64/notify_push
2021-11-02 21:48:41 +01:00
state: link
- name: create service
2021-11-06 16:14:55 +01:00
template:
2021-11-02 21:48:41 +01:00
src: notify_push_service.j2
dest: ~/etc/services.d/notify_push.ini
mode: 0644
notify:
- reload supervisorctl
- update supervisorctl
- name: get backend list
2021-11-06 16:14:55 +01:00
command: uberspace web backend list
2021-11-02 21:48:41 +01:00
register: backends
- name: add backend
2021-11-06 16:14:55 +01:00
when: backends.stdout.find('http:7867') == -1
command: uberspace web backend set /push --http --port 7867
2021-11-02 21:48:41 +01:00
- name: get ip route
2021-11-06 16:14:55 +01:00
command: /usr/sbin/ip route
2021-11-02 21:48:41 +01:00
register: ip
- name: set trusted proxies
2021-11-06 16:14:55 +01:00
command:
2021-11-02 21:48:41 +01:00
chdir: ~/html
2021-11-06 16:14:55 +01:00
cmd: php occ config:system:set trusted_proxies 0 --value="{{ ip.stdout.split().15 }}"
- name: Flush handlers
meta: flush_handlers
2021-11-02 21:48:41 +01:00
- name: configure notify_push app with backend
2021-11-06 16:14:55 +01:00
command:
2021-11-02 21:48:41 +01:00
chdir: ~/html
cmd: php occ notify_push:setup https://{{ domain }}/push