add bridge daemon
This commit is contained in:
parent
673e6c9d04
commit
4557020321
4 changed files with 35 additions and 3 deletions
|
@ -3,3 +3,8 @@
|
||||||
shell:
|
shell:
|
||||||
cmd: npm run build
|
cmd: npm run build
|
||||||
chdir: /srv/matrix-appservice-discord
|
chdir: /srv/matrix-appservice-discord
|
||||||
|
|
||||||
|
- name: Restart the discord bridge
|
||||||
|
systemd:
|
||||||
|
name: bridge_discord
|
||||||
|
state: restarted
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
cmd: npm run build
|
cmd: npm run build
|
||||||
chdir: /srv/matrix-appservice-discord
|
chdir: /srv/matrix-appservice-discord
|
||||||
creates: /srv/matrix-appservice-discord/build
|
creates: /srv/matrix-appservice-discord/build
|
||||||
|
notify: Restart the discord bridge
|
||||||
|
|
||||||
- name: Configure the bridge
|
- name: Configure the bridge
|
||||||
template:
|
template:
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0660'
|
mode: '0660'
|
||||||
|
notify: Restart the discord bridge
|
||||||
|
|
||||||
- name: Generate discord-registration.yaml
|
- name: Generate discord-registration.yaml
|
||||||
shell:
|
shell:
|
||||||
|
@ -72,3 +74,15 @@
|
||||||
src: /srv/matrix-appservice-discord/discord-registration.yaml
|
src: /srv/matrix-appservice-discord/discord-registration.yaml
|
||||||
dest: /etc/matrix-synapse/discord-registration.yaml
|
dest: /etc/matrix-synapse/discord-registration.yaml
|
||||||
state: link
|
state: link
|
||||||
|
|
||||||
|
- name: Copy the daemon configuration
|
||||||
|
template:
|
||||||
|
src: bridge_discord.service
|
||||||
|
dest: /etc/systemd/system/bridge_discord.service
|
||||||
|
notify: Restart the discord bridge
|
||||||
|
|
||||||
|
- name: Enable the daemon
|
||||||
|
systemd:
|
||||||
|
name: bridge_discord
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
||||||
|
|
15
roles/matrix-bridge-discord/templates/bridge_discord.service
Normal file
15
roles/matrix-bridge-discord/templates/bridge_discord.service
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description = Discord Bridge
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=NODE_PORT=3000
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
Restart=on-failure
|
||||||
|
WorkingDirectory=/srv/matrix-appservice-discord
|
||||||
|
ExecStart=npm start
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -1,6 +1,4 @@
|
||||||
# This is a sample of the config file showing all available options.
|
{{ ansible_managed | comment }}
|
||||||
# Where possible we have documented what they do, and all values are the
|
|
||||||
# default values.
|
|
||||||
|
|
||||||
bridge:
|
bridge:
|
||||||
# Domain part of the bridge, e.g. matrix.org
|
# Domain part of the bridge, e.g. matrix.org
|
||||||
|
|
Loading…
Reference in a new issue