diff --git a/handlers/main.yml b/handlers/main.yml index ed97d53..87c3f73 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1 +1,8 @@ --- +- name: Restart mosquitto service + systemd: + state: restarted + daemon_reload: yes + name: mosquitto + listen: + - "mosquitto_restart" diff --git a/tasks/install.yml b/tasks/install.yml index 4be3f2f..478ac0f 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -35,6 +35,8 @@ owner: root group: root mode: 0644 + notify: + - mosquitto_restart - name: Copy passwd files template: @@ -46,6 +48,8 @@ - name: Hash passwd file shell: "mosquitto_passwd -U {{ mosquitto_passwd_file }}" + notify: + - mosquitto_restart - name: Copy systemd unit files template: @@ -54,6 +58,8 @@ owner: root group: root mode: 0644 + notify: + - mosquitto_restart - name: Enable systemd service systemd: