]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Don't try to set devices fact when osd_auto_discovery was skipped mergify/bp/stable-8.0/pr-7620 7621/head
authorDmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
Mon, 28 Oct 2024 16:54:12 +0000 (17:54 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Mon, 28 Oct 2024 22:22:28 +0000 (22:22 +0000)
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

index 95bd82a830c6eb9d4ac40be9dfcdba370590a69a..7f9b3996c483139b320e61bce451c970adc604fc 100644 (file)
@@ -76,5 +76,6 @@
   loop: "{{ devices_check.results }}"
   when:
     - devices_check is defined
+    - devices_check is not skipped
     - not item.skipped | default(false)
     - not item.failed | default(false)