1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/remoteit/tasks/enable-or-disable.yml
2021-10-29 00:11:56 -04:00

28 lines
837 B
YAML

- name: Enable & (Re)Start remote.it's connectd daemon which calls home
systemd:
name: connectd
daemon_reload: yes
enabled: yes
state: restarted
when: remoteit_enabled
- name: Disable & Stop remote.it's connectd daemon
systemd:
name: connectd
enabled: no
state: stopped
when: not remoteit_enabled
- name: Identify remoteit service (connector) unit file name, including uuid
shell: ls /etc/systemd/system/multi-user.target.wants/ | grep remoteit # e.g. remoteit@80:00:01:7F:7E:00:56:36.service
register: remoteit_service
ignore_errors: yes
- name: "Disable & Stop remoteit service: {{ remoteit_service.stdout }}"
systemd:
name: "{{ remoteit_service.stdout }}"
enabled: no
state: stopped
when: not remoteit_enabled and remoteit_service.stdout != ""
ignore_errors: yes