]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
Don't try to set devices fact when osd_auto_discovery was skipped
authorDmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
Mon, 28 Oct 2024 16:54:12 +0000 (17:54 +0100)
committerSeena Fallah <seenafallah@gmail.com>
Tue, 29 Oct 2024 12:30:17 +0000 (13:30 +0100)
commit88b6ecef519e52fcd2b7368905f847fa53dcd1d5
treec88a15d1fca94cada2beae65b5e08fb04d53e5cb
parentde7300e74b25b42033047b6fd2e34b4831ccf7ae
Don't try to set devices fact when osd_auto_discovery was skipped

Right now, under certain OS and Ansible versions, ie Rocky Linux and
ansible-core 2.17, `devices_check` variable is getting defined even if
task was skipped.

That results in set_fact to fail, as resulting variable has no `results`
key in it.

Structure of such variable looks like that:
```
"devices_check": {
    "changed": false,
    "false_condition": "osd_auto_discovery | default(False) | bool",
    "skip_reason": "Conditional result was False",
    "skipped": true
}
```

Checking for task not being skipped solves such issues.

Signed-off-by: Dmitriy Rabotyagov <noonedeadpunk@gmail.com>
(cherry picked from commit 9405558d03b633f8677d0f5f559028ca61ea4403)
roles/ceph-facts/tasks/devices.yml