ansible/roles/matrix-appservice-discord/tasks/main.yml

60 lines
1.7 KiB
YAML
Raw Normal View History

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
# May create issues with package-lock.json not in gitignore
- name: Install matrix-appservice-discord dependencies
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
command: ./node_modules/.bin/tsc
2019-03-10 11:10:59 +01:00
args:
chdir: /var/local/matrix-appservice-discord/matrix-appservice-discord
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:
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