You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/roles/matrix-bridge-discord/tasks/main.yml

73 lines
1.7 KiB
YAML

---
- name: Setup postgres
include_role:
name: postgre
vars:
postgres_users:
- name: bridge_discor_user
password: "{{ matrix_bridge_discor_postgre_user_pwd }}"
databases:
- name: bridge_discord
owner: bridge_discor_user
local: C
template: template0
- name: Install dependencies
apt:
name:
- npm
- git
- pgloader
state: latest
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Ensure the /srv folder exist
file:
path: /srv
state: directory
group: root
owner: root
mode: u=rwx,g=rx,o=rx
- name: Dowload the sources of the bot
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:
src: config.yaml
dest: /srv/matrix-appservice-discord/config.yaml
owner: root
group: root
mode: '0660'
- name: 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: Copy config for synapse
file:
src: /srv/matrix-appservice-discord/discord-registration.yaml
dest: /etc/matrix-synapse/discord-registration.yaml
state: link