From 865d2434ebc0c8f42baa1132d10112e1b3232250 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 9 Oct 2022 16:34:04 -0400 Subject: [PATCH] remoteit/tasks/main.yml: Use skip_role_on_error --- roles/remoteit/tasks/main.yml | 56 ++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/roles/remoteit/tasks/main.yml b/roles/remoteit/tasks/main.yml index 1e1c85230..197010c3b 100644 --- a/roles/remoteit/tasks/main.yml +++ b/roles/remoteit/tasks/main.yml @@ -11,31 +11,39 @@ quiet: yes -- name: Install remoteit if 'remoteit_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml - include_tasks: install.yml - when: remoteit_installed is undefined +- block: + - name: Install remoteit if 'remoteit_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml + include_tasks: install.yml + when: remoteit_installed is undefined -- include_tasks: enable-or-disable.yml + - include_tasks: enable-or-disable.yml -# - 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: 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: - path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini - section: remoteit - option: "{{ item.option }}" - value: "{{ item.value | string }}" - with_items: - - option: name - value: remote.it - - option: description - value: '"https://remote.it can help you remotely maintain an IIAB. Some benefits include: crossing multiple NATs/firewalls using a single TCP port, without requiring router port forwarding, and reducing your network''s vulnerability."' - - option: remoteit_install - value: "{{ remoteit_install }}" - - option: remoteit_enabled - value: "{{ remoteit_enabled }}" - # - option: remoteit_claim_code - # value: "{{ remoteit_claim_code.stdout }}" + - name: Add 'remoteit' variable values to {{ iiab_ini_file }} + ini_file: + path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini + section: remoteit + option: "{{ item.option }}" + value: "{{ item.value | string }}" + with_items: + - option: name + value: remote.it + - option: description + value: '"https://remote.it can help you remotely maintain an IIAB. Some benefits include: crossing multiple NATs/firewalls using a single TCP port, without requiring router port forwarding, and reducing your network''s vulnerability."' + - option: remoteit_install + value: "{{ remoteit_install }}" + - option: remoteit_enabled + value: "{{ remoteit_enabled }}" + # - option: remoteit_claim_code + # value: "{{ remoteit_claim_code.stdout }}" + + rescue: + + - name: 'SEE ERROR ABOVE (skip_role_on_error: {{ skip_role_on_error }})' + fail: + msg: "" + when: not skip_role_on_error