From d35250b8706e4455ea225a6e593566718ff67aed Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 7 Jan 2021 10:49:23 -0500 Subject: [PATCH] Add tasks to verify node has finished (un)flushing --- oneshot/update-pvc-cluster.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/oneshot/update-pvc-cluster.yml b/oneshot/update-pvc-cluster.yml index 7462f8b..a93046a 100644 --- a/oneshot/update-pvc-cluster.yml +++ b/oneshot/update-pvc-cluster.yml @@ -56,6 +56,14 @@ retries: 60 delay: 10 + - name: make sure all VMs have migrated + shell: "pvc node info {{ ansible_hostname }} | grep '^Domain State' | awk '{ print $NF }'" + register: pvcflush + failed_when: pvcflush.stdout != 'flushed' + until: pvcflush.stdout == 'flushed' + retries: 60 + delay: 10 + - name: wait 30 seconds for system to stabilize pause: seconds: "30" @@ -137,7 +145,15 @@ - name: unflush node command: "pvc node ready {{ ansible_hostname }} --wait" - + + - name: make sure all VMs have returned + shell: "pvc node info {{ ansible_hostname }} | grep '^Domain State' | awk '{ print $NF }'" + register: pvcunflush + failed_when: pvcunflush.stdout != 'ready' + until: pvcunflush.stdout == 'ready' + retries: 60 + delay: 10 + - name: wait 30 seconds for system to stabilize pause: seconds: "30"