mon, osd: fix skipped condition

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>
pull/1786/head
Sébastien Han 2017-08-22 14:10:10 +02:00
parent 37ec3bc798
commit a359fc35b4
3 changed files with 3 additions and 3 deletions

View File

@ -75,9 +75,9 @@
- name: import admin keyring into mon keyring - 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 command: ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }} --import-keyring /etc/ceph/{{ cluster }}.client.admin.keyring
when: when:
- not create_custom_admin_secret.get('skipped')
- cephx - cephx
- admin_secret != 'admin_secret' - admin_secret != 'admin_secret'
- not create_custom_admin_secret.get('skipped')
- name: ceph monitor mkfs with keyring - 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 }} command: ceph-mon --cluster {{ cluster }} --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}

View File

@ -50,6 +50,6 @@
- "{{ dedicated_devices|unique }}" - "{{ dedicated_devices|unique }}"
changed_when: false changed_when: false
when: when:
- osd_scenario == 'non-collocated'
- not item.0.get("skipped") - not item.0.get("skipped")
- osd_scenario == 'non-collocated'
- item.0.get("rc", 0) != 0 - item.0.get("rc", 0) != 0

View File

@ -30,8 +30,8 @@
msg: "OSD device autodetection failed because one or more raw partitions is mounted on the host." msg: "OSD device autodetection failed because one or more raw partitions is mounted on the host."
with_items: "{{ mount_cmd.results }}" with_items: "{{ mount_cmd.results }}"
when: when:
- item.rc == 0
- not item.get("skipped") - not item.get("skipped")
- item.rc == 0
- name: check the partition status of the osd disks (autodiscover disks) - name: check the partition status of the osd disks (autodiscover disks)
shell: "parted --script /dev/{{ item.key }} print > /dev/null 2>&1" shell: "parted --script /dev/{{ item.key }} print > /dev/null 2>&1"