From a359fc35b4d9025cc54d7075a413e00c46d7b43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 22 Aug 2017 14:10:10 +0200 Subject: [PATCH] mon, osd: fix skipped condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- roles/ceph-mon/tasks/deploy_monitors.yml | 2 +- roles/ceph-osd/tasks/check_devices.yml | 2 +- roles/ceph-osd/tasks/check_devices_auto.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/ceph-mon/tasks/deploy_monitors.yml b/roles/ceph-mon/tasks/deploy_monitors.yml index eda6747f3..df170065b 100644 --- a/roles/ceph-mon/tasks/deploy_monitors.yml +++ b/roles/ceph-mon/tasks/deploy_monitors.yml @@ -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 }} diff --git a/roles/ceph-osd/tasks/check_devices.yml b/roles/ceph-osd/tasks/check_devices.yml index 784bc3c84..8d68cfd38 100644 --- a/roles/ceph-osd/tasks/check_devices.yml +++ b/roles/ceph-osd/tasks/check_devices.yml @@ -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 diff --git a/roles/ceph-osd/tasks/check_devices_auto.yml b/roles/ceph-osd/tasks/check_devices_auto.yml index 7a1b848ec..e05f96dfd 100644 --- a/roles/ceph-osd/tasks/check_devices_auto.yml +++ b/roles/ceph-osd/tasks/check_devices_auto.yml @@ -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"