From 0ce27a73b60cbc3bb398786b400cdbf033c90a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= Date: Mon, 19 Oct 2020 11:23:59 +0200 Subject: [PATCH] ceph-mon: Fix check mode for deploy monitor tasks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skip the `get initial keyring when it already exists` task when both commands whose `stdout` output it requires have been skipped (e.g. when running in check mode). Signed-off-by: BenoƮt Knecht (cherry picked from commit 2437f145811dfce0ffa83bcf35e8fd711b27d3dd) --- roles/ceph-mon/tasks/deploy_monitors.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/ceph-mon/tasks/deploy_monitors.yml b/roles/ceph-mon/tasks/deploy_monitors.yml index 982bde226..ffaf5fc5d 100644 --- a/roles/ceph-mon/tasks/deploy_monitors.yml +++ b/roles/ceph-mon/tasks/deploy_monitors.yml @@ -30,6 +30,7 @@ - name: get initial keyring when it already exists set_fact: monitor_keyring: "{{ (initial_mon_key.stdout | from_json)[0]['key'] if initial_mon_key is not skipped else monitor_keyring.stdout }}" + when: initial_mon_key.stdout|default('')|length > 0 or monitor_keyring is not skipped - name: create monitor initial keyring ceph_key: