mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	Merge pull request #3010 from holta/remoteit2
Refine & Clarify remote.it (remote support) building on PR #3009
This commit is contained in:
		
						commit
						12ccfa07cf
					
				
					 6 changed files with 64 additions and 39 deletions
				
			
		| 
						 | 
				
			
			@ -12,7 +12,7 @@
 | 
			
		|||
    - "{{ py3_dist_path }}/iiab"    # /usr/lib/python3/dist-packages
 | 
			
		||||
    - "{{ yum_packages_dir }}"    # /opt/iiab/yum-packages
 | 
			
		||||
    - "{{ pip_packages_dir }}"    # /opt/iiab/pip-packages
 | 
			
		||||
    - "{{ downloads_dir }}"    # /opt/iiab/downloads
 | 
			
		||||
    - "{{ downloads_dir }}"    # /opt/iiab/downloads -- generally already done by Stage 1's roles/remoteit/tasks/install.yml
 | 
			
		||||
    #- "{{ content_base }}/downloads"    # /library/downloads auto-created just below
 | 
			
		||||
    - "{{ content_base }}/downloads/zims"
 | 
			
		||||
    - "{{ content_base }}/downloads/maps"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ To install remote.it onto an IIAB:
 | 
			
		|||
   ```
 | 
			
		||||
   <!--EXPLANATION: The above installs remote.it, in a way that was originally designed to be interactive, and provide you the claim code needed to make a remote connection to this IIAB.  The claim code is further explained below.-->
 | 
			
		||||
 | 
			
		||||
3. To obtain this IIAB's 8-letter remote.it claim code, allowing you to make a remote connection to this IIAB, run:
 | 
			
		||||
3. To obtain this IIAB's 8-character remote.it claim code, allowing you to make a remote connection to this IIAB, run:
 | 
			
		||||
   ```
 | 
			
		||||
   sudo grep claim /etc/remoteit/config.json
 | 
			
		||||
   ```
 | 
			
		||||
| 
						 | 
				
			
			@ -40,4 +40,4 @@ For "auto-registration" of remote.it, and other more advanced configuration opti
 | 
			
		|||
# Known Issues
 | 
			
		||||
 | 
			
		||||
- 2021-10-27: This needs to be enhanced rather urgently, so remote.it also works when IIAB is installed on Raspberry Pi OS 11 (Bullseye), Ubuntu, Mint and Debian: [#3006](https://github.com/iiab/iiab/issues/3006)
 | 
			
		||||
- 2021-10-28: The above OS issues should be resolved by [PR #3007](https://github.com/iiab/iiab/pull/3007), but this needs final testing!
 | 
			
		||||
- 2021-10-29: The above OS issues should be resolved by [PR #3007](https://github.com/iiab/iiab/pull/3007), [PR #3009](https://github.com/iiab/iiab/pull/3009) and [PR #3010](https://github.com/iiab/iiab/pull/3010) — but this needs final testing!  (Initial testing occurred on [1] 32-bit Raspberry Pi OS Lite on Raspberry Pi 4 and [2] Ubuntu Server 20.04 on x86_64 VM.)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,27 +6,31 @@
 | 
			
		|||
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
 | 
			
		||||
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
 | 
			
		||||
 | 
			
		||||
# See https://docs.remote.it/cli/overview to refine either value below:
 | 
			
		||||
remoteit_version: 4.13.5
 | 
			
		||||
iset_suffixes:
 | 
			
		||||
  x86_64: amd64
 | 
			
		||||
  aarch64: arm64
 | 
			
		||||
  armv8: arm64.rpi
 | 
			
		||||
 | 
			
		||||
# See https://docs.remote.it/device-package/installation to refine URL below:
 | 
			
		||||
device_suffixes:
 | 
			
		||||
  armv6: armhf.rpi
 | 
			
		||||
  armv6l: armhf.rpi
 | 
			
		||||
  armv7: armhf.rpi
 | 
			
		||||
  armv7l: armhf.rpi
 | 
			
		||||
remoteit_iset_suffix: "{{ iset_suffixes[ansible_architecture] | default('unknown') }}"
 | 
			
		||||
remoteit_deb: remoteit-{{ remoteit_version }}.{{ remoteit_iset_suffix }}.deb
 | 
			
		||||
remoteit_device_url: https://downloads.remote.it/remoteit/v{{ remoteit_version }}/{{ remoteit_deb }}
 | 
			
		||||
 | 
			
		||||
iset_suffixes2:
 | 
			
		||||
  x86_64: amd64
 | 
			
		||||
  armv8: arm64.rpi
 | 
			
		||||
  aarch64: arm64
 | 
			
		||||
  x86_64: amd64
 | 
			
		||||
remoteit_device_suffix: "{{ device_suffixes[ansible_architecture] | default('unknown') }}"
 | 
			
		||||
remoteit_deb: remoteit-{{ remoteit_version }}.{{ remoteit_device_suffix }}.deb
 | 
			
		||||
remoteit_device_url: https://downloads.remote.it/remoteit/v{{ remoteit_version }}/{{ remoteit_deb }}
 | 
			
		||||
# Example...         https://downloads.remote.it/remoteit/v4.13.5/remoteit-4.13.5.armhf.rpi.deb
 | 
			
		||||
 | 
			
		||||
# See https://docs.remote.it/cli/overview to refine URL below:
 | 
			
		||||
cli_suffixes:
 | 
			
		||||
  armv6: armv6
 | 
			
		||||
  armv6l: armv6
 | 
			
		||||
  armv7: armv7
 | 
			
		||||
  armv7l: armv7
 | 
			
		||||
  armv8: arm64
 | 
			
		||||
remoteit_iset_suffix2: "{{ iset_suffixes[ansible_architecture] | default('unknown') }}"
 | 
			
		||||
remoteit_cli_url: https://downloads.remote.it/cli/latest/remoteit_linux_{{ remoteit_iset_suffix2 }}
 | 
			
		||||
  aarch64: arm64
 | 
			
		||||
  x86_64: amd64
 | 
			
		||||
remoteit_cli_suffix: "{{ cli_suffixes[ansible_architecture] | default('unknown') }}"
 | 
			
		||||
remoteit_cli_url: https://downloads.remote.it/cli/latest/remoteit_linux_{{ remoteit_cli_suffix }}
 | 
			
		||||
# Example...      https://downloads.remote.it/cli/latest/remoteit_linux_armv7
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,9 +6,23 @@
 | 
			
		|||
    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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,38 +1,45 @@
 | 
			
		|||
- name: Fail if we detect unknown architecture
 | 
			
		||||
- name: Fail if architecture remoteit_device_suffix == "unknown"
 | 
			
		||||
  fail:
 | 
			
		||||
    msg: "Could not find an apt package for the CPU architecture \"{{ ansible_architecture }}\""
 | 
			
		||||
  when: remoteit_iset_suffix == "unknown"
 | 
			
		||||
    msg: "Could not find a remote.it device apt package for CPU architecture \"{{ ansible_architecture }}\""
 | 
			
		||||
  when: remoteit_device_suffix == "unknown"
 | 
			
		||||
 | 
			
		||||
- name: Fail if we detect unknown architecture
 | 
			
		||||
  fail:
 | 
			
		||||
    msg: "Could not find a binary for the CPU architecture \"{{ ansible_architecture }}\""
 | 
			
		||||
  when: remoteit_iset_suffix2 == "unknown"
 | 
			
		||||
- name: mkdir {{ downloads_dir }}    # As roles/2-common/tasks/fl.yml has not run yet
 | 
			
		||||
  file:
 | 
			
		||||
    path: "{{ downloads_dir }}"    # /opt/iiab/downloads
 | 
			
		||||
    state: directory
 | 
			
		||||
 | 
			
		||||
- name: Download the command line interface for this device to /usr/bin/{{ remoteit_cli_url }} (755)
 | 
			
		||||
- name: Download {{ remoteit_device_url }} (device) for arch {{ remoteit_device_suffix }} into {{ downloads_dir }}/
 | 
			
		||||
  get_url:
 | 
			
		||||
    url: '{{ remoteit_cli_url }}'
 | 
			
		||||
    dest: /usr/bin/
 | 
			
		||||
    mode: 0755
 | 
			
		||||
    url: "{{ remoteit_device_url }}"
 | 
			
		||||
    dest: "{{ downloads_dir }}/"
 | 
			
		||||
 | 
			
		||||
- name: Download {{ remoteit_device_url }} device package to {{ downloads_dir }}/
 | 
			
		||||
  get_url:
 | 
			
		||||
    url: '{{ remoteit_device_url }}'
 | 
			
		||||
    dest: '{{ downloads_dir }}/'
 | 
			
		||||
 | 
			
		||||
- name: Uninstall the device package {{ remoteit_deb }}
 | 
			
		||||
- name: Uninstall previously installed 'remoteit*' device apt package(s)
 | 
			
		||||
  apt:
 | 
			
		||||
    name: '{{ remoteit_deb }}'
 | 
			
		||||
    name: remoteit*
 | 
			
		||||
    state: absent
 | 
			
		||||
  ignore_errors: yes
 | 
			
		||||
 | 
			
		||||
- name: Install device package {{ downloads_dir }}/{{ remoteit_deb }}
 | 
			
		||||
- name: Install device apt package {{ downloads_dir }}/{{ remoteit_deb }}
 | 
			
		||||
  apt:
 | 
			
		||||
    deb: '{{ downloads_dir }}/{{ remoteit_deb }}'
 | 
			
		||||
    deb: "{{ downloads_dir }}/{{ remoteit_deb }}"
 | 
			
		||||
    state: present
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- name: Fail if architecture remoteit_cli_suffix == "unknown"
 | 
			
		||||
  fail:
 | 
			
		||||
    msg: "Could not find a remote.it CLI binary for CPU architecture \"{{ ansible_architecture }}\""
 | 
			
		||||
  when: remoteit_cli_suffix == "unknown"
 | 
			
		||||
 | 
			
		||||
- name: Download {{ remoteit_cli_url }} (CLI) for arch {{ remoteit_cli_suffix }} to /usr/bin/remoteit (755)
 | 
			
		||||
  get_url:
 | 
			
		||||
    url: "{{ remoteit_cli_url }}"
 | 
			
		||||
    dest: /usr/bin/remoteit
 | 
			
		||||
    mode: 0755
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# RECORD remoteit AS INSTALLED
 | 
			
		||||
 | 
			
		||||
- name: "Set 'openvpn_installed: True'"
 | 
			
		||||
- name: "Set 'remoteit_installed: True'"
 | 
			
		||||
  set_fact:
 | 
			
		||||
    remoteit_installed: True
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								test.yml
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								test.yml
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -33,12 +33,12 @@
 | 
			
		|||
    debug:
 | 
			
		||||
      msg: "'\"'"    # FAILS: "'""'"
 | 
			
		||||
 | 
			
		||||
  - name: a shows "VARIABLE IS NOT DEFINED!" -- whereas b (w/o whitespace) AND c (with space) AND d (with tab) show null (without quotes!) -- whereas d (singlequotes) and e (doublequotes) show "" empty string
 | 
			
		||||
  - name: a shows "VARIABLE IS NOT DEFINED!" -- whereas b (w/o whitespace) AND c (with space) AND d (with tab, STRICTLY DISALLOWED IN YAML BY ansible-core 2.11.6) showed null (without quotes!) -- whereas e (singlequotes) and f (doublequotes) show "" empty string
 | 
			
		||||
    set_fact:
 | 
			
		||||
      #a:
 | 
			
		||||
      b:
 | 
			
		||||
      c: # Space
 | 
			
		||||
      d:	# Tab
 | 
			
		||||
      #d:	# Tab
 | 
			
		||||
      e: ''
 | 
			
		||||
      f: ""
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue