2019-03-10 11:10:59 +01:00
|
|
|
---
|
|
|
|
# Create CodiMD user and group
|
|
|
|
- include_tasks: 1_user_group.yml
|
|
|
|
|
|
|
|
# Download CodiMD
|
|
|
|
- name: Clone matrix-appservice-discord project
|
|
|
|
git:
|
|
|
|
repo: https://github.com/Half-Shot/matrix-appservice-discord.git
|
|
|
|
dest: /var/local/matrix-appservice-discord/matrix-appservice-discord
|
|
|
|
version: v0.4.0
|
|
|
|
become: true
|
|
|
|
become_user: matrix-appservice-discord
|
|
|
|
|
|
|
|
# Setup dependencies
|
2019-03-12 16:51:27 +01:00
|
|
|
# May create issues with package-lock.json not in gitignore
|
2019-03-11 17:44:42 +01:00
|
|
|
- name: Install matrix-appservice-discord dependencies
|
2019-03-12 16:51:27 +01:00
|
|
|
npm:
|
|
|
|
path: /var/local/matrix-appservice-discord/matrix-appservice-discord
|
2019-03-10 11:10:59 +01:00
|
|
|
become: true
|
|
|
|
become_user: matrix-appservice-discord
|
2019-03-12 16:56:01 +01:00
|
|
|
register: npm_result
|
|
|
|
retries: 3
|
|
|
|
until: npm_result is succeeded
|
2019-03-10 11:10:59 +01:00
|
|
|
|
|
|
|
# Typescript into javascript
|
|
|
|
- name: Compile matrix-appservice-discord
|
2019-03-12 16:51:27 +01:00
|
|
|
command: ./node_modules/.bin/tsc
|
2019-03-10 11:10:59 +01:00
|
|
|
args:
|
|
|
|
chdir: /var/local/matrix-appservice-discord/matrix-appservice-discord
|
2019-03-12 16:51:27 +01:00
|
|
|
register: npm_build_result
|
|
|
|
changed_when: npm_build_result
|
2019-03-10 11:10:59 +01:00
|
|
|
become: true
|
|
|
|
become_user: matrix-appservice-discord
|
|
|
|
|
|
|
|
# Configure
|
|
|
|
- name: Configure matrix-appservice-discord
|
|
|
|
template:
|
|
|
|
src: config.yaml.j2
|
|
|
|
dest: /var/local/matrix-appservice-discord/matrix-appservice-discord/config.yaml
|
|
|
|
owner: matrix-appservice-discord
|
|
|
|
group: matrix-appservice-discord
|
|
|
|
mode: 0600
|
|
|
|
|
|
|
|
# Service file
|
|
|
|
- name: Install matrix-appservice-discord systemd unit
|
|
|
|
template:
|
2019-03-23 19:13:02 +01:00
|
|
|
src: systemd/matrix-appservice-discord.service.j2
|
|
|
|
dest: /etc/systemd/system/matrix-appservice-discord.service
|
2019-03-10 11:10:59 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: Reload systemd daemons
|
|
|
|
|
|
|
|
# Run
|
|
|
|
#- name: Ensure that matrix-appservice-discord is started
|
|
|
|
# service:
|
|
|
|
# name: matrix-appservice-discord
|
|
|
|
# state: started
|
|
|
|
# enabled: true
|