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

51 lines
1.4 KiB
YAML
Raw Normal View History

---
# Create matrix-appservice-webhooks user and group
- include_tasks: 1_user_group.yml
- name: Clone matrix-appservice-webhooks project
git:
repo: https://github.com/matrix-org/matrix-appservice-webhooks.git
dest: /var/local/matrix-appservice-webhooks/matrix-appservice-webhooks
version: master
become: true
become_user: matrix-appservice-webhooks
# Setup dependencies
- name: Install matrix-appservice-webhooks dependencies
npm:
path: /var/local/matrix-appservice-webhooks/matrix-appservice-webhooks
production: true
become: true
become_user: matrix-appservice-webhooks
register: npm_result
retries: 3
until: npm_result is succeeded
# Configure
- name: Configure matrix-appservice-webhooks
template:
src: config.yaml.j2
dest: /var/local/matrix-appservice-webhooks/matrix-appservice-webhooks/config/config.yaml
owner: matrix-appservice-webhooks
group: matrix-appservice-webhooks
mode: 0600
# Service file
- name: Install matrix-appservice-webhooks systemd unit
template:
src: 'systemd/matrix-appservice-webhooks.service.j2'
dest: '/etc/systemd/system/matrix-appservice-webhooks.service'
owner: root
group: root
mode: 0644
notify: Reload systemd daemons
# TODO: See https://github.com/turt2live/matrix-appservice-webhooks
# Run
#- name: Ensure that matrix-appservice-webhooks is started
# service:
# name: matrix-appservice-webhooks
# state: started
# enabled: true