ansible/roles/matrix_appservice_webhooks/tasks/main.yml

59 lines
1.3 KiB
YAML
Raw Permalink Normal View History

---
2019-03-29 19:25:11 +01:00
# Create service user
- include_tasks: service_user.yml
- name: "Clone {{ service_name }} project"
git:
repo: "{{ service_repo }}"
dest: "{{ service_path }}"
version: master
become: true
become_user: "{{ service_user }}"
# Setup dependencies
- name: "Install {{ service_name }} dependencies"
npm:
path: "{{ service_path }}"
production: true
become: true
become_user: "{{ service_user }}"
register: npm_result
retries: 3
until: npm_result is succeeded
- name: "Configure {{ service_name }}"
template:
src: config.yaml.j2
dest: "{{ service_path }}/config/config.yaml"
owner: "{{ service_user }}"
2019-03-29 19:25:11 +01:00
group: nogroup
mode: 0600
# Service file
- name: "Install {{ service_name }} systemd unit"
template:
src: systemd/appservice.service.j2
dest: "/etc/systemd/system/{{ service_name }}.service"
owner: root
group: root
mode: 0644
2019-03-29 19:25:11 +01:00
# TODO generate registration
- name: Copy appservice registration file
copy:
src: "{{ service_path }}/appservice-registration-webhooks.yaml"
dest: "/etc/matrix-synapse/{{ service_name }}-registration.yaml"
2019-03-29 19:25:11 +01:00
owner: matrix-synapse
group: nogroup
mode: 0600
2019-05-03 22:50:48 +02:00
remote_src: true
# Run
- name: "Ensure that {{ service_name }} is started"
2019-04-06 15:19:52 +02:00
systemd:
name: "{{ service_name }}"
2019-03-29 19:25:11 +01:00
state: started
enabled: true
2019-04-06 15:19:52 +02:00
daemon_reload: true