57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
---
|
|
# Install APT dependencies
|
|
- include_tasks: 0_apt_dependencies.yml
|
|
|
|
# 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
|
|
- name: Install matrix-appservice-discord depedencies
|
|
command: npm ci
|
|
args:
|
|
chdir: /var/local/matrix-appservice-discord/matrix-appservice-discord
|
|
become: true
|
|
become_user: matrix-appservice-discord
|
|
|
|
# Typescript into javascript
|
|
- name: Compile matrix-appservice-discord
|
|
command: npm run build
|
|
args:
|
|
chdir: /var/local/matrix-appservice-discord/matrix-appservice-discord
|
|
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:
|
|
src: 'systemd/matrix-appservice-discord.service.j2'
|
|
dest: '/etc/systemd/system/matrix-appservice-discord.service'
|
|
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
|