-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
setup defines ansible_selinux as a boolean or as a dict #18692
Comments
@dagwieers: Thanks for taking the time to open this issue, but it was filed under the wrong github repository. Please create a new issue at https://github.com/ansible/ansible-modules-core/issues |
@ansibot You are quite wrong, this is part of ansible/ansible. Oh, why am I talking to a bot :-) EDIT: remove broken command -jctanner |
bot_skip |
Some of this was discussed in short in a core meeting, although from a slightly different topic. |
@sivel Thanks for the pointer ! However what was concluded does not seem to be implemented. (I haven't seen the output in the Shippable console). Is this somewhere on a TODO list ? Something I could be working on maybe ? |
Fixed in #31065. Cherry-picked for inclusion in 2.4.1. |
ISSUE TYPE
COMPONENT NAME
setup / facts
ANSIBLE VERSION
v2.2 and older
SUMMARY
Looking at the code https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts.py#L420 it defines ansible_selinux either as a boolean (False) when HAVE_SELINUX is False, but as a dictionary when HAVE_SELINUX is True.
That is bad design, it makes it harder to test for specific properties.
https://github.com/ansible/ansible/pull/18690/files#diff-6ef0fa8be07ffd2967bf772e9d792339R20
fails if it is a boolean, so I now have to rewrite this as:
and I won't be certain that this will not fail in some weird way (like maybe on some platform it returns True instead of a dictionary with status key).
The text was updated successfully, but these errors were encountered: