From 6c9e2fb272511ff4c180a4626dc4a74d26794907 Mon Sep 17 00:00:00 2001 From: Zolfa Date: Sun, 13 Dec 2020 20:24:27 +0100 Subject: [PATCH] roles/riot-web: bump to 1.7.15, add tags --- roles/riot-web/defaults/main.yaml | 4 +-- roles/riot-web/tasks/main.yaml | 55 ++---------------------------- roles/riot-web/tasks/riot-web.yaml | 55 ++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 55 deletions(-) create mode 100644 roles/riot-web/tasks/riot-web.yaml diff --git a/roles/riot-web/defaults/main.yaml b/roles/riot-web/defaults/main.yaml index 7fcd5b3..859e326 100644 --- a/roles/riot-web/defaults/main.yaml +++ b/roles/riot-web/defaults/main.yaml @@ -1,6 +1,6 @@ -# Based on https://github.com/vector-im/riot-web/releases +# Based on https://github.com/vector-im/element-web/releases --- -riot_web_version: "v1.6.8" +riot_web_version: "v1.7.15" riot_web_nginx_fqdn: "riot.{{ domain }}" synapse_nginx_fqdn: "matrix.{{ domain }}" synapse_domain: "{{ domain }}" diff --git a/roles/riot-web/tasks/main.yaml b/roles/riot-web/tasks/main.yaml index 1bebf39..299c46d 100644 --- a/roles/riot-web/tasks/main.yaml +++ b/roles/riot-web/tasks/main.yaml @@ -1,56 +1,5 @@ --- -- name: 'create riot-web folder' - file: - path: '/srv/riot-web' - state: 'directory' - mode: '0755' - owner: 'www-data' - group: 'www-data' +- import_tasks: 'riot-web.yaml' tags: - - 'packages' - -- name: 'download riot-web' - unarchive: - src: "https://github.com/vector-im/riot-web/releases/download/\ - {{ riot_web_version }}/riot-{{ riot_web_version }}.tar.gz" - dest: '/srv/riot-web' - remote_src: true - owner: 'www-data' - group: 'www-data' - tags: - - 'packages' - -- name: 'configure nginx location' - template: - src: 'riot.conf' - dest: '/etc/nginx/locations/{{ riot_web_nginx_fqdn }}/riot.conf' - notify: - - 'reload nginx' - -- name: 'configure riot web' - template: - src: 'config.json.j2' - dest: '/srv/riot-web/riot-{{ riot_web_version }}/config.json' - -- name: 'MONITORING | add HTTP service' - block: - - name: 'MONITORING | add service to monitoring entry' - set_fact: - monitoring_entry: > - {{ monitoring_entry | default({}) | combine({ - 'address': ansible_host, - 'vhosts_uri': { riot_web_nginx_fqdn: {'/': 'Riot'} }, - }, recursive=true) }} - - name: 'MONITORING | update monitoring facts' - set_fact: - monitoring_facts: > - {{ hostvars[monitoring_host]['monitoring_facts'] - | default({}) - | combine({host_fqdn: monitoring_entry}) }} - delegate_facts: true - delegate_to: '{{ monitoring_host }}' - tags: - - 'monitoring' -... - + - 'role::riot-web' ... diff --git a/roles/riot-web/tasks/riot-web.yaml b/roles/riot-web/tasks/riot-web.yaml new file mode 100644 index 0000000..60e5b5f --- /dev/null +++ b/roles/riot-web/tasks/riot-web.yaml @@ -0,0 +1,55 @@ +--- +- name: 'create riot-web folder' + file: + path: '/srv/riot-web' + state: 'directory' + mode: '0755' + owner: 'www-data' + group: 'www-data' + tags: + - 'packages' + +- name: 'download riot-web' + unarchive: + src: "https://github.com/vector-im/element-web/releases/download/\ + {{ riot_web_version }}/element-{{ riot_web_version }}.tar.gz" + dest: '/srv/riot-web' + remote_src: true + owner: 'www-data' + group: 'www-data' + tags: + - 'packages' + +- name: 'configure nginx location' + template: + src: 'riot.conf' + dest: '/etc/nginx/locations/{{ riot_web_nginx_fqdn }}/riot.conf' + notify: + - 'reload nginx' + +- name: 'configure riot web' + template: + src: 'config.json.j2' + dest: '/srv/riot-web/riot-{{ riot_web_version }}/config.json' + +- name: 'MONITORING | add HTTP service' + block: + - name: 'MONITORING | add service to monitoring entry' + set_fact: + monitoring_entry: > + {{ monitoring_entry | default({}) | combine({ + 'address': ansible_host, + 'vhosts_uri': { riot_web_nginx_fqdn: {'/': 'Riot'} }, + }, recursive=true) }} + - name: 'MONITORING | update monitoring facts' + set_fact: + monitoring_facts: > + {{ hostvars[monitoring_host]['monitoring_facts'] + | default({}) + | combine({host_fqdn: monitoring_entry}) }} + delegate_facts: true + delegate_to: '{{ monitoring_host }}' + tags: + - 'monitoring' +... +