ansible-debops-infrastructure

DebOps and Ansible scripts to manage my infrastructure
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

commit 79bacc2ec9a4060f64a0d1e2962e7f5277b45b0b
parent 8c6e1417e60dbfcd896224890f3b83ab59bbfa83
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Sun,  3 Nov 2019 23:31:32 +0200

riot: Initialize role to setup Riot IM

Diffstat:
ansible/roles/riot/defaults/main.yml | 22++++++++++++++++++++++
ansible/roles/riot/tasks/main.yml | 37+++++++++++++++++++++++++++++++++++++
ansible/roles/riot/templates/config.json | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 112 insertions(+), 0 deletions(-)

diff --git a/ansible/roles/riot/defaults/main.yml b/ansible/roles/riot/defaults/main.yml @@ -0,0 +1,21 @@ +--- + +riot__signing_key: https://packages.riot.im/riot-release-key.asc + +riot__release_version: "1.5.0" + +riot__release_checksum: "c39c4ad3ad876426d9b99d3924468bb69cbc8e9de00ea2fc22a086c94b7ee079850897d6920c215c37d0fa25243098c04bd4588c8cd71385d01015253834f660" + +riot__release_url: "https://github.com/vector-im/riot-web/releases/download/v{{ riot__release_version }}/riot-v{{ riot__release_version }}.tar.gz" + +riot__release_signature_url: "https://github.com/vector-im/riot-web/releases/download/v{{ riot__release_version }}/riot-v{{ riot__release_version }}.tar.gz.asc" + +riot__deploy_directory: "" + +riot__matrix_homeserver: "https://matrix.org" + +riot__matrix_server_name: "matrix.org" + +riot__matrix_identity_server: "https://vector.im" + +riot__brand: "Riot"+ \ No newline at end of file diff --git a/ansible/roles/riot/tasks/main.yml b/ansible/roles/riot/tasks/main.yml @@ -0,0 +1,36 @@ +--- + +- name: Download Riot GPG key + get_url: + url: "{{ riot__signing_key }}" + dest: /tmp/riot-release-key.asc + +- name: Import Riot GPG key + shell: gpg --import /tmp/riot-release-key.asc + +- name: Download Riot release + get_url: + url: "{{ riot__release_url }}" + dest: /tmp/ + checksum: "sha512:{{ riot__release_checksum }}" + +- name: Download Riot signature file + get_url: + url: "{{ riot__release_signature_url }}" + dest: /tmp/ + +- name: Verify Riot release with signature file + shell: "gpg --verify /tmp/riot-v{{ riot__release_version }}.tar.gz.asc /tmp/riot-v{{ riot__release_version }}.tar.gz" + +- name: Extract and deploy Riot to the webserver directory + unarchive: + src: /tmp/riot-v{{ riot__release_version }}.tar.gz + dest: "{{ riot__deploy_directory }}" + remote_src: yes + extra_opts: [--strip-components=1] + +- name: Configure Riot + template: + src: config.json + dest: "{{ riot__deploy_directory }}/config.json" + tags: ["riot::configure"]+ \ No newline at end of file diff --git a/ansible/roles/riot/templates/config.json b/ansible/roles/riot/templates/config.json @@ -0,0 +1,53 @@ +{ + "default_server_config": { + "m.homeserver": { + "base_url": " {{ riot__matrix_homeserver | d('https://matrix.org') }}", + "server_name": "{{ riot__matrix_server_name | d('matrix.org') }}" + }, + "m.identity_server": { + "base_url": "{{ riot__matrix_identity_server | d('https://vector.im') }}" + } + }, + "disable_custom_urls": false, + "disable_guests": true, + "disable_login_language_selector": false, + "disable_3pid_login": false, + "brand": "{{ riot__brand | d('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" + ], + "integrations_jitsi_widget_url": "https://scalar.vector.im/api/widgets/jitsi.html", + "bug_report_endpoint_url": "https://riot.im/bugreports/submit", + "defaultCountryCode": "GB", + "showLabsSettings": false, + "features": { + "feature_pinning": "labs", + "feature_custom_status": "labs", + "feature_custom_tags": "labs", + "feature_state_counters": "labs" + }, + "default_federate": true, + "default_theme": "dark", + "roomDirectory": { + "servers": [ + {% for server in riot__server_room_directory|d([]) %} + "{{ server }}", + {% endfor %} + "matrix.org" + ] + }, + "welcomeUserId": "@riot-bot:matrix.org", + "piwik": false, + "enable_presence_by_hs_url": { + "https://matrix.org": false + }, + "settingDefaults": { + "breadcrumbs": true + } +}