Skip to content

Commit 5ba3b2c

Browse files
author
Dmitriy Rabotyagov
committed
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 <[email protected]>
1 parent c9ffb2e commit 5ba3b2c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

roles/ceph-facts/tasks/devices.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@
7676
loop: "{{ devices_check.results }}"
7777
when:
7878
- devices_check is defined
79+
- devices_check is not skipped
7980
- not item.skipped | default(false)
8081
- not item.failed | default(false)

0 commit comments

Comments
 (0)