From bc54f67e59ff32a7e8b65e2d18f9f78bc4483325 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Fri, 6 Aug 2021 03:28:11 +0200 Subject: [PATCH] build stuff and generate config --- roles/matrix-bridge-discord/tasks/main.yml | 21 ++++++++++++++++++--- roles/synapse/handlers/main.yml | 4 ++-- roles/synapse/tasks/main.yml | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/roles/matrix-bridge-discord/tasks/main.yml b/roles/matrix-bridge-discord/tasks/main.yml index 6ecbdd9..bedcb64 100644 --- a/roles/matrix-bridge-discord/tasks/main.yml +++ b/roles/matrix-bridge-discord/tasks/main.yml @@ -37,6 +37,18 @@ git: repo: 'https://github.com/t2bot/matrix-appservice-discord.git' dest: /srv/matrix-appservice-discord +# They should be an handler here the rebuild the bot + +- name: Build typescript + shell: + cmd: npm run build + chdir: /srv/matrix-appservice-discord + creates: /srv/matrix-appservice-discord/build + +- name: Install dependencies + npm: + path: /srv/matrix-appservice-discord + state: latest - name: Configure the bridge template: @@ -47,10 +59,13 @@ mode: '0660' - name: Generate discord-registration.yaml - debug: - msg: "TODO: Generate discord-registration.yaml" + shell: + cmd: "node build/src/discordas.js -r -u 'http://localhost:9005' -c config.yaml" + chdir: /srv/matrix-appservice-discord + creates: /srv/matrix-appservice-discord/discord-registration.yaml + notify: Restart synapse -- name: +- name: Copy config for synapse file: src: /srv/matrix-appservice-discord/discord-registration.yaml dest: /etc/matrix-synapse/discord-registration.yaml diff --git a/roles/synapse/handlers/main.yml b/roles/synapse/handlers/main.yml index d616788..d3cefba 100644 --- a/roles/synapse/handlers/main.yml +++ b/roles/synapse/handlers/main.yml @@ -4,7 +4,7 @@ name: nginx state: reloaded -- name: Reload synapse +- name: Restart synapse systemd: name: matrix-synapse - state: reloaded + state: restarted diff --git a/roles/synapse/tasks/main.yml b/roles/synapse/tasks/main.yml index 61b4411..d33490b 100644 --- a/roles/synapse/tasks/main.yml +++ b/roles/synapse/tasks/main.yml @@ -58,7 +58,7 @@ template: src: homeserver.yaml dest: /etc/matrix-synapse/homeserver.yaml - notify: Reload synapse + notify: Restart synapse # --- DRAFT --- - name: Install nginx