-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix: Print an error message when module to be created doesn't exist #218
fix: Print an error message when module to be created doesn't exist #218
Conversation
tasks/selinux_load_module.yml
Outdated
when: not module_file.stat.checksum in checksum | ||
when: >- | ||
(not module_file.stat.exists) or | ||
(module_file.stat.exists and not module_file.stat.checksum in checksum) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while this seems correct, unfortunately it will break https://github.com/linux-system-roles/selinux/blob/main/tests/tests_selinux_modules.yml#L149 because an error won't be raised by this code. I think we should not fix this. Or, if we do, we need to figure out if it is ok to always raise an error if not module_file.stat.exists
326d2e7
to
41e489f
Compare
[citest] |
tasks/selinux_load_module.yml
Outdated
@@ -26,6 +26,11 @@ | |||
delegate_to: localhost | |||
become: false | |||
|
|||
- name: Raise an error when module file doesn't exist | |||
fail: | |||
msg: The module that you try to install doesn't exist in {{ item.path }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg: The module that you try to install doesn't exist in {{ item.path }} | |
msg: The module that you try to install doesn't exist in {{ __selinux_item.path }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because #217 merged
41e489f
to
14e980a
Compare
14e980a
to
81480a3
Compare
[citest] |
the rhel6 and 7 failures are known and seen occasionally |
Enhancement: Print an error message when module to be created doesn't exist
Reason: When specifying a non-existent file with
selinux_modules.path
the role fails with an informative message that the module file that you try to install doesn't exist.