This commit is contained in:
Dryusdan 2019-08-30 23:57:53 +02:00
parent 3f6bcb3c43
commit a91eb16e4c
4 changed files with 131 additions and 0 deletions

12
host.example Normal file
View File

@ -0,0 +1,12 @@
---
# Riot
riot:
username: riot #existant user
user_home: /var/www/riot #existant folder
version: 1.3.3
default_hs_url: https://matrix.org
default_hs_name: matrix.org
default_is_url: https://matrix.org
brand: Riot
domain: riot.example.org

6
riot.yml Normal file
View File

@ -0,0 +1,6 @@
---
- hosts: riot
user: root
gather_facts: yes
roles:
- riot

68
riot/tasks/main.yml Normal file
View File

@ -0,0 +1,68 @@
---
- name: create www folder
file:
path: "{{ riot.user_home }}/www"
state: directory
mode: 0755
- name: Get Riot
get_url:
url: "https://github.com/vector-im/riot-web/releases/download/v{{ riot.version }}/riot-v{{ riot.version }}.tar.gz"
dest: /tmp/riot.tar.gz
become: yes
become_user: "{{ riot.username }}"
become_method: su
become_flags: '-s /bin/bash'
- name: Unarchive a file that is already on the remote machine
unarchive:
src: /tmp/riot.tar.gz
dest: /tmp
remote_src: yes
- name: "Change owner"
file:
path: "/tmp/riot-v{{ riot.version }}"
owner: "{{ riot.username }}"
group: "{{ riot.username }}"
- name: "Remove file"
file:
path: "{{ riot.user_home }}/www"
state: absent
- name: "Move riot extract in riot folder"
command: "mv /tmp/riot-v{{ riot.version }}/ {{ riot.user_home }}/www/"
become: yes
become_user: "{{ riot.username }}"
become_method: su
become_flags: '-s /bin/bash'
- name: "Set conf"
template:
src: config.json.j2
dest: "{{ riot.user_home }}/www/config.json"
owner: "{{ riot.username }}"
group: "{{ riot.username }}"
mode: 0644
- name: make simlink
file:
src: "{{ riot.user_home }}/www/config.json"
dest: "{{ riot.user_home }}/www/config.{{ riot.domain }}.json"
state: link
become: yes
become_user: "{{ riot.username }}"
become_method: su
become_flags: '-s /bin/bash'
- name: "Remove tmp file"
file:
path: "/tmp/riot-v{{ riot.version }}"
state: absent
- name: "Remove tmp file"
file:
path: "/tmp/riot.tar.gz"
state: absent

View File

@ -0,0 +1,45 @@
{
"default_server_config": {
"m.homeserver": {
"base_url": "{{ riot.default_hs_url }}",
"server_name": "{{ riot.default_hs_name }}"
},
"m.identity_server": {
"base_url": "{{ riot.default_is_url }}"
}
},
"disable_custom_urls": false,
"disable_guests": false,
"disable_login_language_selector": false,
"disable_3pid_login": false,
"brand": "{{ riot.brand }}",
"integrations_ui_url": "https://scalar.vector.im/",
"integrations_rest_url": "https://scalar.vector.im/api",
"integrations_jitsi_widget_url": "https://scalar.vector.im/api/widgets/jitsi.html",
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
"defaultCountryCode": "FR",
"showLabsSettings": false,
"features": {
"feature_groups": "enable",
"feature_pinning": "enable",
"feature_reactions": "enable",
"feature_message_editing": "enable"
},
"default_federate": true,
"default_theme": "light",
"roomDirectory": {
"servers": [
"matrix.org"
]
},
"welcomeUserId": "@riot-bot:matrix.org",
"piwik": {
"url": "",
"whitelistedHSUrls": [],
"whitelistedISUrls": [],
"siteId": 1
},
"enable_presence_by_hs_url": {
"https://matrix.org": false
}
}