From 9dea02808c49ad56d52b73b3bbc8c9f237efc351 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 10:16:52 +1100 Subject: [PATCH] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 32 +++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 040b2ef..54e74c1 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -169,25 +169,33 @@ register: atl_product_completed when: download_binary -# If product installer was fetched -# Make the moving directory -# - failure, continue and install from temp -# - success, move binary and install from shared_home - +# If product installer was fetched make the moving directory - name: Create moving_lock. file: path: "{{ atl_product_home_shared_moving_lock }}" state: directory - when: download_binary is succeeded + when: + - atl_product_completed is succeeded register: moving_lock_created -- name: Debug Scenario A - lock created - debug: lock created - when: moving_lock_created is succeeded +# Directory lock was created by this run +# - Move binary +- name: Move binary Scenario - lock created by this run + debug: + msg: lock created + set_fact: + move_binary: true + when: + - moving_lock_created is succeeded + - moving_lock_created.changed == True -- name: Debug Scenario B - lock cannot created - debug: lock not created - when: moving_lock_created is failed +# Directory lock was either already created or could not be +# - Continue and install from temp +- name: Continue Scenario - lock cannot be created or created by previous run + debug: + msg: lock not created + when: moving_lock_created is not succeeded or + ( moving_lock_created is succeeded and moving_lock_created.changed == False )