Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try to set devices fact when osd_auto_discovery was skipped #7620

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

noonedeadpunk
Copy link
Contributor

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]

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]>
@noonedeadpunk
Copy link
Contributor Author

Would be very nice if it's possible to backport to stable-8.0 as well

@clwluvw clwluvw merged commit 9405558 into ceph:main Oct 28, 2024
27 checks passed
@noonedeadpunk noonedeadpunk deleted the devices_check_skipped branch October 29, 2024 10:07
@noonedeadpunk
Copy link
Contributor Author

Thanks a ton for prompt review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants