ansible/roles/matrix-appservice-irc/tasks/main.yml
2019-03-29 19:25:11 +01:00

58 lines
1.4 KiB
YAML

---
# Create service user
- include_tasks: service_user.yml
- name: "Clone {{ appservice_name }} project"
git:
repo: "{{ appservice_repo }}"
dest: "{{ appservice_path }}"
version: 0.11.2
become: true
become_user: "{{ appservice_user }}"
# Setup dependencies
- name: "Install {{ appservice_name }} dependencies"
npm:
path: "{{ appservice_path }}"
production: true
become: true
become_user: "{{ appservice_user }}"
register: npm_result
retries: 3
until: npm_result is succeeded
- name: "Configure {{ appservice_name }}"
template:
src: config.yaml.j2
dest: "{{ appservice_path }}/config.yaml"
owner: "{{ appservice_user }}"
group: nogroup
mode: 0600
# Service file
- name: "Install {{ appservice_name }} systemd unit"
template:
src: systemd/matrix-appservice-irc.service.j2
dest: "/etc/systemd/system/{{ appservice_name }}.service"
owner: root
group: root
mode: 0644
notify: Reload systemd daemons
# TODO generate registration
#- name: Copy appservice registration file
# copy:
# src: "{{ appservice_path }}/discord-registration.yaml"
# dest: "/etc/matrix-synapse/{{ appservice_name }}-registration.yaml"
# owner: matrix-synapse
# group: nogroup
# mode: 0600
# remote_src: yes
# Run
#- name: Ensure that matrix-appservice-irc is started
# service:
# name: matrix-appservice-irc
# state: started
# enabled: true