Skip to content

Commit

Permalink
[ansible/config] Restart systemd service when configuration changed
Browse files Browse the repository at this point in the history
  • Loading branch information
goldyfruit committed Dec 4, 2023
1 parent eb69030 commit a15c2df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions ansible/roles/ovos_installer/tasks/ovos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@
group: "{{ ovos_installer_user }}"
mode: '0600'
backup: true
register: _configuration
4 changes: 3 additions & 1 deletion ansible/roles/ovos_installer/tasks/virtualenv/systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
ansible.builtin.meta: flush_handlers

- name: Enable and start OVOS and/or HiveMind systemd units
vars:
_state: "{{ 'restarted' if _configuration.changed | bool else 'started' }}"
become: true
become_user: "{{ item.user }}"
ansible.builtin.systemd_service:
name: "{{ item.unit }}"
enabled: true
force: true
state: started
state: "{{ _state }}"
scope: "{{ item.scope }}"
loop:
- {"unit": "ovos-messagebus.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if ovos_installer_profile != 'satellite' else false }}"}
Expand Down

0 comments on commit a15c2df

Please sign in to comment.