mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Allow remote.it license key to be pasted into local_vars.yml
This commit is contained in:
parent
c8769a8ea6
commit
dcc6615d72
5 changed files with 82 additions and 18 deletions
|
|
@ -1,6 +1,20 @@
|
|||
- 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: Copy OPTIONAL remoteit_license_key, e.g. from /etc/iiab/local_vars.yml to /etc/remoteit/registration, if remoteit_enabled and remoteit_license_key is defined
|
||||
# shell: echo {{ remoteit_license_key }} > /etc/remoteit/registration
|
||||
template:
|
||||
src: registration.j2
|
||||
dest: /etc/remoteit/registration
|
||||
when: remoteit_enabled and remoteit_license_key is defined
|
||||
|
||||
- name: Redact OPTIONAL remoteit_license_key from /etc/iiab/local_vars.yml, if remoteit_enabled and remoteit_license_key is defined
|
||||
# shell: sed -i '/^remoteit_license_key:/d' {{ iiab_local_vars_file }}
|
||||
lineinfile:
|
||||
path: "{{ iiab_local_vars_file }}"
|
||||
regexp: '^remoteit_license_key:.*'
|
||||
state: absent
|
||||
when: remoteit_enabled and remoteit_license_key is defined
|
||||
|
||||
# 2022-04-06 QUESTION: Does connectd (below) delete /etc/remoteit/registration,
|
||||
# but only after confirming online that the license key is valid?
|
||||
|
||||
- name: Enable & Restart remote.it "parent" service connectd, which exits after spawning 2 "child" services/daemons below
|
||||
systemd:
|
||||
|
|
@ -35,10 +49,6 @@
|
|||
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
|
||||
|
|
|
|||
|
|
@ -24,6 +24,23 @@
|
|||
purge: yes
|
||||
ignore_errors: yes
|
||||
|
||||
|
||||
# Speeds things up a bit, deferring online claim code generation if not nec:
|
||||
# https://docs.remote.it/oem-and-bulk-provisioning/registration-into-a-users-account
|
||||
|
||||
- name: "'mkdir /etc/remoteit' e.g. if your 'remoteit_license_key: 592AA9BB-XXXX-YYYY-ZZZZ-6E27654C3DF6' exists in /etc/iiab/local_vars.yml"
|
||||
file:
|
||||
state: directory
|
||||
path: /etc/remoteit
|
||||
when: remoteit_license_key is defined
|
||||
|
||||
- name: "'touch /etc/remoteit/registration' e.g. if your 'remoteit_license_key: 592AA9BB-XXXX-YYYY-ZZZZ-6E27654C3DF6' exists in /etc/iiab/local_vars.yml"
|
||||
file:
|
||||
state: touch
|
||||
path: /etc/remoteit/registration
|
||||
when: remoteit_license_key is defined
|
||||
|
||||
|
||||
# - name: "Install Device Package: {{ downloads_dir }}/{{ remoteit_deb }}"
|
||||
# apt:
|
||||
# deb: "{{ downloads_dir }}/{{ remoteit_deb }}"
|
||||
|
|
@ -32,13 +49,10 @@
|
|||
# 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
|
||||
|
|
|
|||
|
|
@ -18,9 +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: Extract claim code from /etc/remoteit/config.json if it exists
|
||||
# shell: grep claim /etc/remoteit/config.json | rev | cut -d\" -f2 | rev
|
||||
# register: remoteit_claim_code
|
||||
|
||||
- name: Add 'remoteit' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
|
|
@ -37,5 +37,5 @@
|
|||
value: "{{ remoteit_install }}"
|
||||
- option: remoteit_enabled
|
||||
value: "{{ remoteit_enabled }}"
|
||||
- option: remoteit_claim_code
|
||||
value: "{{ remoteit_claim.stdout }}"
|
||||
# - option: remoteit_claim_code
|
||||
# value: "{{ remoteit_claim_code.stdout }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue