From fe30e1f461f240cb7c4a2c6d54cecda648fe9764 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 16:41:51 -0500 Subject: [PATCH] Reinforce multiarch & offline logic. Fail w/ explanation if kiwix-tools tarfile not in place. --- roles/kiwix/tasks/main.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index a12a82ece..3bf1b16f8 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -17,17 +17,27 @@ when: ansible_machine == "i686" # COMMENT OUT LINE ABOVE TO TEST i686 CODE PATH ON X86_64 (WORKS NOV 2017) +- debug: + msg: "WARNING: kiwix-tools SOFTWARE APPEARS UNAVAILABLE FOR YOUR OS/ARCHITECTURE." + when: not kiwix_src_file + - name: Download Kiwix software to /opt/iiab/downloads get_url: url: "{{ iiab_download_url }}/{{ kiwix_src_file }}" dest: "{{ downloads_dir }}/{{ kiwix_src_file }}" when: internet_available +- name: Check for /opt/iiab/downloads/{{ kiwix_src_file }} + stat: + path: "{{ downloads_dir }}/{{ kiwix_src_file }}" + register: kiwix_src + +- name: FAIL (force Ansible to exit) IF /opt/iiab/downloads/{{ kiwix_src_file }} doesn't exist + fail: + msg: "{ downloads_dir }}/{{ kiwix_src_file }} is REQUIRED in order to install Kiwix." + when: not kiwix_src.stat.exists + - include_tasks: kiwix_install.yml - when: kiwix_src_file is defined +# when: kiwix_src_file is defined tags: - kiwix - -- debug: - msg: "WARNING: kiwix-tools SOFTWARE NOT FOUND FOR YOUR OS/ARCHITECTURE." - when: not kiwix_src_file