Reload systemd services when they get updated

Fixes #69 (Github Issue)
This commit is contained in:
Slavi Pantaleev
2019-03-03 11:55:15 +02:00
parent 041a1947b3
commit 45618679f5
12 changed files with 139 additions and 2 deletions

View File

@ -30,8 +30,14 @@
src: "{{ role_path }}/templates/systemd/matrix-coturn.service.j2"
dest: "/etc/systemd/system/matrix-coturn.service"
mode: 0644
register: matrix_coturn_systemd_service_result
when: matrix_coturn_enabled
- name: Ensure systemd reloaded after matrix-coturn.service installation
service:
daemon_reload: yes
when: "matrix_coturn_enabled and matrix_coturn_systemd_service_result.changed"
- name: Allow access to Coturn ports in firewalld
firewalld:
port: "{{ item }}"
@ -67,6 +73,11 @@
state: absent
when: "not matrix_coturn_enabled and matrix_coturn_service_stat.stat.exists"
- name: Ensure systemd reloaded after matrix-coturn.service removal
service:
daemon_reload: yes
when: "not matrix_coturn_enabled and matrix_coturn_service_stat.stat.exists"
- name: Ensure Matrix coturn paths don't exist
file:
path: "{{ matrix_coturn_base_path }}"
@ -77,4 +88,4 @@
docker_image:
name: "{{ matrix_coturn_docker_image }}"
state: absent
when: "not matrix_coturn_enabled"
when: "not matrix_coturn_enabled"