mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 19:52:06 +00:00
54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
- name: Fail if architecture remoteit_device_suffix == "unknown"
|
|
fail:
|
|
msg: "Could not find a remote.it device apt package for CPU architecture \"{{ ansible_architecture }}\""
|
|
when: remoteit_device_suffix == "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_device_url }} (device) for arch {{ remoteit_device_suffix }} into {{ downloads_dir }}/
|
|
get_url:
|
|
url: "{{ remoteit_device_url }}"
|
|
dest: "{{ downloads_dir }}/"
|
|
force: yes
|
|
timeout: "{{ download_timeout }}"
|
|
|
|
- name: Uninstall previously installed 'remoteit*' device apt package(s)
|
|
apt:
|
|
name: remoteit*
|
|
state: absent
|
|
ignore_errors: yes
|
|
|
|
- name: Install device apt package {{ downloads_dir }}/{{ remoteit_deb }}
|
|
apt:
|
|
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
|
|
force: yes
|
|
timeout: "{{ download_timeout }}"
|
|
|
|
|
|
# RECORD remoteit AS INSTALLED
|
|
|
|
- name: "Set 'remoteit_installed: True'"
|
|
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'
|