From 7b877171c321471fff1297c28c62a3e9757a7880 Mon Sep 17 00:00:00 2001 From: Cory Hawkvelt Date: Tue, 6 Dec 2022 13:21:15 +1030 Subject: [PATCH] conditional to make not run every time --- tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 36d4d4d..c160ff6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,18 +9,18 @@ template: src: templates/rbd_secret.xml.j2 dest: /tmp/secret.xml -# when: virsh_secret_result.rc != 0 + when: virsh_secret_result is defined and virsh_secret_result.rc != 0 ignore_errors: yes tags: libvirt-secret - name: Define libvirt RBD secret command: virsh secret-define /tmp/secret.xml -# when: virsh_secret_result.rc != 0 + when: virsh_secret_result is defined and virsh_secret_result.rc != 0 ignore_errors: yes tags: libvirt-secret - name: Set libvirt RBD secret command: virsh secret-set-value {{ rbd_secret_uuid }} {{ rbd_secret_key }} -# when: virsh_secret_result.rc != 0 + when: virsh_secret_result is defined and virsh_secret_result.rc != 0 ignore_errors: yes tags: libvirt-secret