1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Merge branch 'claim' of https://github.com/jvonau/iiab into remoteit_license_key

This commit is contained in:
root 2022-04-06 15:14:39 -04:00
commit c8769a8ea6
4 changed files with 18 additions and 1 deletions

View file

@ -49,3 +49,4 @@ cli_suffixes:
x86_64: x86_64
remoteit_cli_suffix: "{{ cli_suffixes[ansible_architecture] | default('unknown') }}"
remoteit_cli_url: https://downloads.remote.it/cli/latest/remoteit_linux_{{ remoteit_cli_suffix }}
remoteit_REGISTRATION_CODE: none #eg "592AA9BB-68C8-520A-AACA-6E27654C3DF6" generated in the desktop or web portal

View file

@ -1,3 +1,7 @@
- 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
@ -31,6 +35,10 @@
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

View file

@ -32,10 +32,13 @@
# apt:
# deb: "{{ remoteit_device_url }}"
- name: Going to use pre-created REGISTRATION_CODE from desktop or web portal
shell: mkdir /etc/remoteit || true && touch /etc/remoteit/registration
when: remoteit_REGISTRATION_CODE is not none
- name: Install remote.it Device Package for your CPU/OS, using https://downloads.remote.it/remoteit/install_agent.sh -- this puts a claim code in /etc/remoteit/config.json which is valid for 24h
shell: curl -L https://downloads.remote.it/remoteit/install_agent.sh | sh
- name: Install /usr/bin/iiab-remoteit from template -- so IIAB operators can quickly enable remote.it AND generate a new remote.it claim code (in /etc/remoteit/config.json) -- optionally downloading + installing the very latest Device Package (like the 2 steps above)
template:
src: iiab-remoteit

View file

@ -18,6 +18,9 @@
- include_tasks: enable-or-disable.yml
- name: Find the claim code if blank the machine was registrated
shell: grep claim /etc/remoteit/config.json | rev | cut -d\" -f2 | rev
register: remoteit_claim
- name: Add 'remoteit' variable values to {{ iiab_ini_file }}
ini_file:
@ -34,3 +37,5 @@
value: "{{ remoteit_install }}"
- option: remoteit_enabled
value: "{{ remoteit_enabled }}"
- option: remoteit_claim_code
value: "{{ remoteit_claim.stdout }}"