2021-10-29 04:11:56 +00:00
|
|
|
- name: Fail if architecture remoteit_device_suffix == "unknown"
|
2021-10-28 07:09:24 +00:00
|
|
|
fail:
|
2021-10-29 04:11:56 +00:00
|
|
|
msg: "Could not find a remote.it device apt package for CPU architecture \"{{ ansible_architecture }}\""
|
|
|
|
when: remoteit_device_suffix == "unknown"
|
2021-10-28 07:09:24 +00:00
|
|
|
|
2021-10-29 04:11:56 +00:00
|
|
|
- name: mkdir {{ downloads_dir }} # As roles/2-common/tasks/fl.yml has not run yet
|
|
|
|
file:
|
|
|
|
path: "{{ downloads_dir }}" # /opt/iiab/downloads
|
|
|
|
state: directory
|
2021-10-25 18:59:16 +00:00
|
|
|
|
2021-10-29 04:11:56 +00:00
|
|
|
- name: Download {{ remoteit_device_url }} (device) for arch {{ remoteit_device_suffix }} into {{ downloads_dir }}/
|
2021-10-27 21:29:31 +00:00
|
|
|
get_url:
|
2021-10-29 04:11:56 +00:00
|
|
|
url: "{{ remoteit_device_url }}"
|
|
|
|
dest: "{{ downloads_dir }}/"
|
2021-10-29 04:50:16 +00:00
|
|
|
force: yes
|
2021-12-26 15:24:31 +00:00
|
|
|
timeout: "{{ download_timeout }}"
|
2021-10-27 21:29:31 +00:00
|
|
|
|
2021-10-29 04:11:56 +00:00
|
|
|
- name: Uninstall previously installed 'remoteit*' device apt package(s)
|
2021-10-27 21:29:31 +00:00
|
|
|
apt:
|
2021-10-28 23:04:40 +00:00
|
|
|
name: remoteit*
|
2021-10-27 23:10:09 +00:00
|
|
|
state: absent
|
2021-10-29 04:11:56 +00:00
|
|
|
ignore_errors: yes
|
2021-10-27 23:10:09 +00:00
|
|
|
|
2021-10-29 04:11:56 +00:00
|
|
|
- name: Install device apt package {{ downloads_dir }}/{{ remoteit_deb }}
|
2021-10-25 18:59:16 +00:00
|
|
|
apt:
|
2021-10-29 04:11:56 +00:00
|
|
|
deb: "{{ downloads_dir }}/{{ remoteit_deb }}"
|
2021-10-27 23:10:09 +00:00
|
|
|
state: present
|
|
|
|
|
2021-10-25 18:59:16 +00:00
|
|
|
|
2021-10-29 04:11:56 +00:00
|
|
|
- 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
|
2021-10-29 04:50:16 +00:00
|
|
|
force: yes
|
2021-12-26 15:24:31 +00:00
|
|
|
timeout: "{{ download_timeout }}"
|
2021-10-29 04:11:56 +00:00
|
|
|
|
|
|
|
|
2021-10-25 18:59:16 +00:00
|
|
|
# RECORD remoteit AS INSTALLED
|
|
|
|
|
2021-10-28 23:00:00 +00:00
|
|
|
- name: "Set 'remoteit_installed: True'"
|
2021-10-25 18:59:16 +00:00
|
|
|
set_fact:
|
|
|
|
remoteit_installed: True
|
|
|
|
|
|
|
|
- name: "Add 'remoteit_installed: True' to {{ iiab_state_file }}"
|
|
|
|
lineinfile:
|
|
|
|
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
|
|
|
regexp: '^remoteit_installed'
|
|
|
|
line: 'remoteit_installed: True'
|