---
- name: Reload hermes systemd user
  become: true
  become_user: "{{ hermes_user }}"
  ansible.builtin.systemd:
    daemon_reload: true
    scope: user
  environment:
    XDG_RUNTIME_DIR: "/run/user/{{ hermes_user_uid.stdout }}"

- name: Restart hermes gateway
  become: true
  become_user: "{{ hermes_user }}"
  ansible.builtin.systemd:
    name: hermes-gateway
    state: restarted
    scope: user
  environment:
    XDG_RUNTIME_DIR: "/run/user/{{ hermes_user_uid.stdout }}"
