]> git-server-git.apps.pok.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>
Wed, 28 Apr 2021 13:18:49 +0000 (15:18 +0200)
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>
(cherry picked from commit 2437f145811dfce0ffa83bcf35e8fd711b27d3dd)

roles/ceph-mon/tasks/deploy_monitors.yml

index fb4a8eeaeeb4371a68ade0d9707379525aae4b92..066185395f7e2681dedb4cc709e1e7d9fd10c997 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: