]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-mon: Fix check mode for deploy monitor tasks
authorBenoît Knecht <bknecht@protonmail.ch>
Mon, 19 Oct 2020 09:23:59 +0000 (11:23 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 12 Mar 2021 17:19:46 +0000 (18:19 +0100)
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 <bknecht@protonmail.ch>
roles/ceph-mon/tasks/deploy_monitors.yml

index 982bde22682cec74359caf2932d304ea95b5de3e..ffaf5fc5d214ece20660bcfa41ca7d56e39fe41c 100644 (file)
@@ -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: