From 9a3565016668229ec940b748ee0b4c2b1f82a9dd Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Mon, 22 Jul 2019 10:32:34 +0200 Subject: [PATCH] Move Riot web to docker --- matrix.yml | 5 -- roles/matrix-riot/handlers/main.yml | 6 -- roles/matrix-riot/tasks/main.yml | 75 ----------------------- roles/matrix-riot/templates/nginx/riot.j2 | 20 ------ 4 files changed, 106 deletions(-) delete mode 100644 roles/matrix-riot/handlers/main.yml delete mode 100644 roles/matrix-riot/tasks/main.yml delete mode 100644 roles/matrix-riot/templates/nginx/riot.j2 diff --git a/matrix.yml b/matrix.yml index 32af6fe..11e63e8 100644 --- a/matrix.yml +++ b/matrix.yml @@ -13,11 +13,6 @@ - matrix-appservice-irc - matrix-appservice-webhooks -# Install Matrix Riot on corresponding containers -- hosts: riot.adm.auro.re - roles: - - matrix-riot - # Install Matrix services - hosts: matrix-services.adm.auro.re roles: diff --git a/roles/matrix-riot/handlers/main.yml b/roles/matrix-riot/handlers/main.yml deleted file mode 100644 index 4307d64..0000000 --- a/roles/matrix-riot/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Reload the NGINX service -- name: Reload NGINX service - service: - name: nginx - state: reloaded diff --git a/roles/matrix-riot/tasks/main.yml b/roles/matrix-riot/tasks/main.yml deleted file mode 100644 index f2b7a75..0000000 --- a/roles/matrix-riot/tasks/main.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -# Install HTTPS support for APT -- name: Install apt-transport-https - apt: - update_cache: true - name: apt-transport-https - state: present - register: apt_result - retries: 3 - until: apt_result is succeeded - -# Add the key -- name: Configure the apt key - apt_key: - url: https://riot.im/packages/debian/repo-key.asc - id: D7B0B66941D01538 - state: present - register: apt_key_result - retries: 3 - until: apt_key_result is succeeded - -# Add the repository into source list -- name: Configure riot repository - apt_repository: - repo: deb https://riot.im/packages/debian/ {{ ansible_distribution_release }} main - state: present - -- name: Install riot-web - apt: - update_cache: true - name: riot-web - state: present - register: apt_result - retries: 3 - until: apt_result is succeeded - -- name: Configure riot-web - lineinfile: - path: /opt/Riot/resources/webapp/config.json - regexp: '^\s*\"{{ item[0] }}' - line: " \"{{ item[0] }}\": \"{{ item[1] }}\"," - loop: - - ['default_hs_url', 'https://auro.re'] - - ['default_is_url', 'https://auro.re'] - - ['brand', 'Riot Aurore'] - -- name: Install nginx - apt: - name: nginx - state: present - register: apt_result - retries: 3 - until: apt_result is succeeded - -- name: Configure nginx - template: - src: nginx/riot.j2 - dest: /etc/nginx/sites-available/riot - mode: 0644 - notify: Reload NGINX service - -# Desactive useless nginx sites -- name: Deactivate the default NGINX site - file: - path: /etc/nginx/sites-enabled/default - state: absent - notify: Reload NGINX service - -# Activate sites -- name: Activate sites - file: - src: /etc/nginx/sites-available/riot - dest: /etc/nginx/sites-enabled/riot - state: link - notify: Reload NGINX service diff --git a/roles/matrix-riot/templates/nginx/riot.j2 b/roles/matrix-riot/templates/nginx/riot.j2 deleted file mode 100644 index c5d128c..0000000 --- a/roles/matrix-riot/templates/nginx/riot.j2 +++ /dev/null @@ -1,20 +0,0 @@ -# {{ ansible_managed }} - -server { - listen 80; - listen [::]:80; - - root /opt/Riot/resources/webapp/; - index index.html; - - access_log /var/log/nginx/riot-access.log; - error_log /var/log/nginx/riot-errors.log; - - add_header X-Content-Type-Options nosniff; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Frame-Options "SAMEORIGIN" always; - - location / { - try_files $uri $uri/ =404; - } -}