Update to 2022-03-07 16:00

This commit is contained in:
Daniel Berteaud
2022-03-07 16:00:05 +01:00
parent be6bc20783
commit 1065df387c
99 changed files with 761 additions and 303 deletions

View File

@@ -0,0 +1,31 @@
---
# Only change several instances are deployed on the same server
# in which case you must also set a different riot_root_dir
riot_id: riot
# Version to deploy, and expected sha1
riot_version: 1.7.14
# sha1sum of the tar.gz
riot_archive_sha1: 1f2d304bfa27ae3a67f21e5d1b527a71811623ff
# Where to install riot
riot_root_dir: /opt/matrix/riot
# Default servers
# riot_default_home_server: https://matrix.org
riot_default_identity_server: https://vector.im
# Should ansible manage upgrades or only initial install
riot_manage_upgrade: True
# Should a alilas be created, eg riot to access it on /riot
# riot_web_alias: riot
# Optional list of allowed IP address. If undefined, everyone can access it
# riot_allowed_ip:
# - 12.13.14.15
# - 16.17.18.19
# Jitsi server to use
# riot_jitsi_server: jitsi.example.net

View File

@@ -0,0 +1,3 @@
---
- include: ../httpd_common/handlers/main.yml
...

View File

@@ -0,0 +1,3 @@
---
dependencies:
- role: httpd_common

View File

@@ -0,0 +1,9 @@
---
- import_tasks: ../includes/webapps_compress_archive.yml
vars:
- root_dir: "{{ riot_root_dir }}"
- version: "{{ riot_current_version }}"
when: riot_install_mode == 'upgrade'
tags: matrix

View File

@@ -0,0 +1,7 @@
---
- import_tasks: ../includes/webapps_archive.yml
vars:
- root_dir: "{{ riot_root_dir }}"
- version: "{{ riot_current_version }}"
tags: matrix

View File

@@ -0,0 +1,8 @@
---
- name: Remove temp files
file: path={{ riot_root_dir }}/tmp/{{ item }} state=absent
with_items:
- riot-v{{ riot_version }}.tar.gz
- riot-v{{ riot_version }}
tags: matrix

View File

@@ -0,0 +1,15 @@
---
- name: Remove sample config file
file: path={{ riot_root_dir }}/web/config.sample.json state=absent
tags: matrix
- name: Deploy configuration
template: src=config.json.j2 dest={{ riot_root_dir }}/web/config.json
tags: matrix
- name: Deploy httpd configuration
template: src=httpd.conf.j2 dest=/etc/httpd/ansible_conf.d/10-riot_{{ riot_id }}.conf
notify: reload httpd
tags: matrix

View File

@@ -0,0 +1,11 @@
---
- name: Create directory structure
file: path={{ riot_root_dir }}/{{ item.dir }} state=directory owner={{ item.owner | default(omit) }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }}
with_items:
- dir: tmp
- dir: archives
mode: 700
- dir: meta
mode: 700
tags: matrix

View File

@@ -0,0 +1,12 @@
---
- import_tasks: ../includes/webapps_set_install_mode.yml
vars:
- root_dir: "{{ riot_root_dir }}"
- version: "{{ riot_version }}"
tags: matrix
- set_fact: riot_install_mode={{ (install_mode == 'upgrade' and not riot_manage_upgrade) | ternary('none',install_mode) }}
tags: matrix
- set_fact: riot_current_version={{ current_version | default('') }}
tags: matrix

View File

@@ -0,0 +1,28 @@
---
- name: Download Riot
get_url:
url: "https://github.com/vector-im/riot-web/releases/download/v{{ riot_version }}/riot-v{{ riot_version }}.tar.gz"
dest: "{{ riot_root_dir }}/tmp/"
checksum: "sha1:{{ riot_archive_sha1 }}"
when: riot_install_mode != 'none'
tags: matrix
- name: Extract riot archive
unarchive:
src: "{{ riot_root_dir }}/tmp/riot-v{{ riot_version }}.tar.gz"
dest: "{{ riot_root_dir }}/tmp/"
remote_src: True
when: riot_install_mode != 'none'
tags: matrix
- name: Move the content of riot to the correct top directory
synchronize:
src: "{{ riot_root_dir }}/tmp/riot-v{{ riot_version }}/"
dest: "{{ riot_root_dir }}/web/"
recursive: True
delete: True
delegate_to: "{{ inventory_hostname }}"
when: riot_install_mode != 'none'
tags: matrix

View File

@@ -0,0 +1,13 @@
---
- include: facts.yml
- include: directories.yml
- include: archive_pre.yml
when: riot_install_mode == 'upgrade'
- include: install.yml
- include: conf.yml
- include: archive_post.yml
when: riot_install_mode == 'upgrade'
- include: write_version.yml
- include: cleanup.yml

View File

@@ -0,0 +1,7 @@
---
- import_tasks: ../includes/webapps_post.yml
vars:
- root_dir: "{{ riot_root_dir }}"
- version: "{{ riot_version }}"
tags: matrix

View File

@@ -0,0 +1,30 @@
{
"default_hs_url": "{{ riot_default_home_server | default('https://' + synapse_server_name) | default('https://matrix.org') }}",
"default_is_url": "{{ riot_default_identity_server }}",
"brand": "Riot",
"integrations_ui_url": "https://scalar.vector.im/",
"integrations_rest_url": "https://scalar.vector.im/api",
"integrations_widgets_urls": [
"https://scalar.vector.im/_matrix/integrations/v1",
"https://scalar.vector.im/api",
"https://scalar-staging.vector.im/_matrix/integrations/v1",
"https://scalar-staging.vector.im/api",
"https://scalar-staging.riot.im/scalar/api"
],
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
"enableLabs": true,
"roomDirectory": {
"servers": [
"matrix.org"
]
},
"welcomeUserId": "@riot-bot:matrix.org",
"piwik": {
},
{% if riot_jitsi_server is defined %}
"jitsi": {
"preferredDomain": "{{ riot_jitsi_server }}"
},
{% endif %}
"happyJson": true
}

View File

@@ -0,0 +1,14 @@
{% if riot_web_alias is defined %}
Alias /{{ riot_web_alias }} {{ riot_root_dir }}/web
{% else %}
# No alias defined, create a vhost to access it
{% endif %}
<Directory {{ riot_root_dir }}/web>
AllowOverride None
Options None
{% if riot_allowed_ip is defined %}
Require ip {{ riot_allowed_ip | join(' ') }}
{% else %}
Require all granted
{% endif %}
</Directory>

View File

@@ -0,0 +1,5 @@
#!/bin/sh
chown -R root:root {{ riot_root_dir }}
find {{ riot_root_dir }}/web -type f -exec chmod 644 "{}" \;
find {{ riot_root_dir }}/web -type d -exec chmod 755 "{}" \;