]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commit
ceph-osd: Fix start_osds.yml in check mode
authorBenoît Knecht <bknecht@protonmail.ch>
Mon, 13 Dec 2021 12:59:17 +0000 (13:59 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 16 Feb 2022 08:50:53 +0000 (09:50 +0100)
commit9df27fc5c51e70a8f4aa0556dbde312fae5054d2
tree83d49158866fcc7971bc0900170d7beb22d8cd4f
parent0431746d32dfb8ccbc98dd2227e047d53f5a156f
ceph-osd: Fix start_osds.yml in check mode

This construct doesn't work as intended since ansible/ansible#74212:

```
ceph_osd_ids.stdout | default('{}') | from_json
```

That PR made the `command` module return `stdout` even in check mode (setting
it to the empty string), so `default()` has no effect in that case and
`from_json()` fails to parse an empty string.

Instead, `default()` needs to be invoked with its second argument set to
`True`, so that it replaces any `False` value (such as an empty string) with
its first argument:

```
ceph_osd_ids.stdout | default('{}', True) | from_json
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 0b3a608216708e8005ed4fc34122f0fc61d0d459)
roles/ceph-osd/tasks/start_osds.yml