]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mon, osd: fix skipped condition 1786/head
authorSébastien Han <seb@redhat.com>
Tue, 22 Aug 2017 12:10:10 +0000 (14:10 +0200)
committerSébastien Han <seb@redhat.com>
Tue, 22 Aug 2017 16:34:51 +0000 (18:34 +0200)
To be properly evaluated the "skipped" conditions must always have the
first place on the list of condition, otherwise the other conditions are
evaluated before and make the task fail.

Closes: https://github.com/ceph/ceph-ansible/issues/1733
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-osd/tasks/check_devices.yml
roles/ceph-osd/tasks/check_devices_auto.yml

index eda6747f3199bb0b48a2329316d00ec7054f3756..df170065b68afd9a7f10e87448a88edce0fbef9d 100644 (file)
@@ -75,9 +75,9 @@
 - name: import admin keyring into mon keyring
   command: ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }} --import-keyring /etc/ceph/{{ cluster }}.client.admin.keyring
   when:
+    - not create_custom_admin_secret.get('skipped')
     - cephx
     - admin_secret != 'admin_secret'
-    - not create_custom_admin_secret.get('skipped')
 
 - name: ceph monitor mkfs with keyring
   command: ceph-mon --cluster {{ cluster }} --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
index 784bc3c8498a0df5feca9fb68f12419afc228027..8d68cfd38c1f2530bcce3078aa057f75ea37bda5 100644 (file)
@@ -50,6 +50,6 @@
     - "{{ dedicated_devices|unique }}"
   changed_when: false
   when:
-    - osd_scenario == 'non-collocated'
     - not item.0.get("skipped")
+    - osd_scenario == 'non-collocated'
     - item.0.get("rc", 0) != 0
index 7a1b848ec637b8223748919fc5c2bc91ab96309b..e05f96dfd2e3bd95be2b59ae2f5c006ecb28d32c 100644 (file)
@@ -30,8 +30,8 @@
     msg: "OSD device autodetection failed because one or more raw partitions is mounted on the host."
   with_items: "{{ mount_cmd.results }}"
   when:
-    - item.rc == 0
     - not item.get("skipped")
+    - item.rc == 0
 
 - name: check the partition status of the osd disks (autodiscover disks)
   shell: "parted --script /dev/{{ item.key }} print > /dev/null 2>&1"