2021-12-19 20:14:23 +01:00
|
|
|
- hosts: autoreply_editor
|
2021-12-19 20:51:04 +01:00
|
|
|
gather_facts: true
|
2021-12-19 20:14:23 +01:00
|
|
|
tasks:
|
|
|
|
|
- name: Get newest version of autoreply-editor
|
|
|
|
|
git:
|
|
|
|
|
repo: https://src.mehl.mx/mxmehl/autoreply-editor.git
|
|
|
|
|
dest: autoreply-editor
|
2021-12-23 13:56:58 +01:00
|
|
|
notify: restart supervisord
|
2021-12-19 20:14:23 +01:00
|
|
|
|
|
|
|
|
- name: Deploy config file
|
|
|
|
|
template:
|
|
|
|
|
src: config.py.j2
|
|
|
|
|
dest: autoreply-editor/config.py
|
2021-12-23 13:56:58 +01:00
|
|
|
notify: restart supervisord
|
2021-12-19 20:51:04 +01:00
|
|
|
|
|
|
|
|
- name: Install specified python requirements
|
|
|
|
|
pip:
|
|
|
|
|
requirements: requirements.txt
|
|
|
|
|
chdir: autoreply-editor
|
|
|
|
|
extra_args: --user
|
|
|
|
|
|
|
|
|
|
- name: Register domain for service
|
|
|
|
|
command: "uberspace web domain add {{ domain }}"
|
|
|
|
|
register: cmdrtrn
|
2021-12-19 22:45:07 +01:00
|
|
|
failed_when:
|
|
|
|
|
# Adding an already registered domain fails, but we ignore this specific error
|
|
|
|
|
- cmdrtrn.rc != 0
|
|
|
|
|
- "'It is already configured for your Uberspace account' not in cmdrtrn.stderr"
|
2021-12-19 20:51:04 +01:00
|
|
|
|
|
|
|
|
- name: Create web backend for service
|
|
|
|
|
command: "uberspace web backend set {{ domain }} --http --port {{ port }}"
|
|
|
|
|
|
|
|
|
|
- name: Deploy supervisord service
|
|
|
|
|
template:
|
|
|
|
|
src: autoreply-editor.ini.j2
|
|
|
|
|
dest: etc/services.d/autoreply-editor.ini
|
|
|
|
|
notify: reload supervisord
|
|
|
|
|
|
2021-12-19 21:05:18 +01:00
|
|
|
- name: Create autoresponders directory
|
|
|
|
|
file:
|
|
|
|
|
path: autoresponders
|
|
|
|
|
state: directory
|
|
|
|
|
|
2021-12-19 20:51:04 +01:00
|
|
|
handlers:
|
|
|
|
|
- name: reread supervisord
|
|
|
|
|
command: supervisorctl reread
|
|
|
|
|
listen: reload supervisord
|
|
|
|
|
- name: update supervisord
|
|
|
|
|
command: supervisorctl update
|
|
|
|
|
listen: reload supervisord
|
2021-12-23 13:56:58 +01:00
|
|
|
- name: restart supervisord
|
|
|
|
|
command: supervisorctl restart autoreply-editor
|