1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Refine remote.it for Ubuntu etc

This commit is contained in:
root 2021-10-29 00:11:56 -04:00
parent 5dc9ca1783
commit f25cd7a069
6 changed files with 61 additions and 48 deletions

View file

@ -6,17 +6,6 @@
state: restarted
when: remoteit_enabled
- name: Find the uuid for the connector
shell: ls /etc/systemd/system/multi-user.target.wants/ | grep remoteit
register: remoteit_service
ignore_errors: yes
- name: Stop the uuid {{ remoteit_service.stdout }}
systemd:
name: "{{ remoteit_service.stdout }}"
enabled: no
state: stopped
when: not remoteit_enabled and not remoteit_service.stdout == ""
- name: Disable & Stop remote.it's connectd daemon
systemd:
@ -24,3 +13,16 @@
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

View file

@ -1,35 +1,42 @@
- 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 {{ remoteit_cli_url }} for the {{ remoteit_iset_suffix2 }} arch of this device to /usr/bin/remoteit (755)
- name: Download {{ remoteit_device_url }} (device) for arch {{ remoteit_device_suffix }} into {{ downloads_dir }}/
get_url:
url: '{{ remoteit_cli_url }}'
dest: /usr/bin/remoteit
mode: 0755
url: "{{ remoteit_device_url }}"
dest: "{{ downloads_dir }}/"
- name: Download {{ remoteit_device_url }} for the {{ remoteit_iset_suffix }} arch of this device package to {{ downloads_dir }}
get_url:
url: '{{ remoteit_device_url }}'
dest: '{{ downloads_dir }}/'
- name: Uninstall the device 'remoteit' deb package
- name: Uninstall previously installed 'remoteit*' device apt package(s)
apt:
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 'remoteit_installed: True'"