mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
53 lines
2 KiB
YAML
53 lines
2 KiB
YAML
- name: Using pre-created REGISTRATION_CODE from desktop or web portal
|
|
shell: echo {{ remoteit_REGISTRATION_CODE }} > /etc/remoteit/registration
|
|
when: remoteit_REGISTRATION_CODE is not none
|
|
|
|
- name: Enable & Restart remote.it "parent" service connectd, which exits after spawning 2 "child" services/daemons below
|
|
systemd:
|
|
name: connectd
|
|
daemon_reload: yes
|
|
enabled: yes
|
|
state: restarted
|
|
when: remoteit_enabled
|
|
|
|
- name: Enable remote.it daemon schannel ("Remote tcp command service") -- try to avoid contention with connectd which auto-spawns it as nec (just above)
|
|
systemd:
|
|
name: schannel
|
|
enabled: yes
|
|
state: started
|
|
when: remoteit_enabled
|
|
|
|
|
|
- name: Disable & Stop remote.it services {connectd, schannel}
|
|
systemd:
|
|
name: "{{ item }}"
|
|
enabled: no
|
|
state: stopped
|
|
with_items:
|
|
- connectd
|
|
- schannel
|
|
when: not remoteit_enabled
|
|
|
|
- name: Stop & Disable "Remote tcp connection services" remoteit@* found in /etc/systemd/system/multi-user.target.wants/ e.g. remoteit@80:00:01:7F:7E:00:56:36.service
|
|
shell: |
|
|
systemctl stop $(ls /etc/systemd/system/multi-user.target.wants/ | grep remoteit@*)
|
|
systemctl disable $(ls /etc/systemd/system/multi-user.target.wants/ | grep remoteit@*)
|
|
ignore_errors: yes
|
|
when: not remoteit_enabled
|
|
|
|
- name: Clean up REGISTRATION_CODE from {{ iiab_local_vars_file }} if used
|
|
shell: sed -i '/remoteit_REGISTRATION_CODE/d' {{ iiab_local_vars_file }}
|
|
when: remoteit_REGISTRATION_CODE is not none
|
|
|
|
# - name: Identify remoteit "Remote tcp connection service" unit file name, including uuid, e.g. remoteit@80:00:01:7F:7E:00:56:36.service
|
|
# shell: ls /etc/systemd/system/multi-user.target.wants/ | grep remoteit@
|
|
# register: remoteit_service
|
|
# ignore_errors: yes
|
|
|
|
# - name: "Disable & Stop the actual service: {{ remoteit_service.stdout }}"
|
|
# systemd:
|
|
# name: "{{ remoteit_service.stdout }}"
|
|
# enabled: no
|
|
# state: stopped
|
|
# when: not remoteit_enabled and remoteit_service.stdout != ""
|
|
# ignore_errors: yes
|