community.general
community.general copied to clipboard
Add --equal equivalent to sefcontext
SUMMARY
Add the ability to idempotently add and remove an fcontext equivalence, mirroring the 'semanage fcontext --equal' operations.
This operation requires a bogus setype, or even a valid one for that matter, as the value is unused, and I did not want to make the conditional change to AnsibleModule(... setype=dict(type='str', required=True), ...
New tests were added to tests/integration/targets/sefcontext/tasks/sefcontext.yml.
During testing it was discovered that deletions using 'semanage fcontext' do not work for an individual equivalence deletion, only --deleteall, which blows out ALL local settings. This makes this module an improvement over the command line tools in this case.
This should address https://github.com/ansible-collections/community.general/issues/1193
Signed-off-by: Doug Maxey [email protected]
ISSUE TYPE
- Feature Pull Request
COMPONENT NAME
community.general.sefcontext
cc @dagwieers click here for bot help
The test ansible-test sanity --test validate-modules [explain] failed with 1 error:
plugins/modules/system/sefcontext.py:0:0: doc-default-does-not-match-spec: Argument 'equiv' in argument_spec defines default as (None) but documentation defines default as ('None')
The test ansible-test sanity --test validate-modules [explain] failed with 1 error:
plugins/modules/system/sefcontext.py:0:0: doc-default-does-not-match-spec: Argument 'equiv' in argument_spec defines default as (None) but documentation defines default as ('None')
The test ansible-test sanity --test validate-modules [explain] failed with 1 error:
plugins/modules/system/sefcontext.py:0:0: doc-default-does-not-match-spec: Argument 'equiv' in argument_spec defines default as (None) but documentation defines default as ('None')
The test ansible-test sanity --test validate-modules [explain] failed with 1 error:
plugins/modules/system/sefcontext.py:0:0: doc-default-does-not-match-spec: Argument 'equiv' in argument_spec defines default as (None) but documentation defines default as ('None')
Docs Build 📝
This PR is closed and any previously published docsite has been unpublished.
Please hold off on moving this forward while I investigate an issue outside the testcase,
Re-ran the testcases to see if I missed it there, but all still pass.
Am getting a 'KeyError: equiv' traceback running this in production. Debugging it now.
Please hold off on moving this forward while I investigate an issue outside the testcase,
Re-ran the testcases to see if I missed it there, but all still pass.
Am getting a 'KeyError: equiv' traceback running this in production. Debugging it now.
Aha. Due to pathing, was picking up an older modules version with the bug, fixed in the latest. So there is no error when using the correct current version.
So the hold is not needed.
FYI: Testing environment is current ansible 2.12.2 on rhel 8 and 9.
Other than the adjustments pointed by @felixfontein , it LGTM
Please note this also requires a changelog fragment. Looks like I forgot to mention that in my first review :)
I was making a contribution, that appears to have violated your idea of what makes a valid contribution.
Quibbles over style stopping the benefit of the contribution are on you.
I don't care that you make editorial changes if necessary to align with your worldview. My part is done.
Your contribution seems to be quite valid, however this community is keen to maintain the documentation up to date and consistent, and that includes nits like formatting, punctuation and what not. Other than that, we only suggested an improvement in the code that makes it simpler and more readable. You seem to have taken the comments as personal offenses, but we make that kind of adjustments to all contributions.
You are free to let this PR die as it is. I think it would be a shame, but if that's your choice, that's how it's going to be.
Nope, nothing personal, Just an observation.
If your process does not allow minor editorial changes, it's broken.
The process allows it, of course. But this is a community: "our" community (you included), not "yours" or "mine" as your language points to. People volunteer time to this work, they don't have to do the editorial work dumped upon them, especially when it comes paired with passive-aggressive rhetoric. A different tone might have got you much further in gathering other people's help.
Please update the PR according to the review comments. Otherwise we will close it eventually. Thanks.
needs_info
@dithotxgh This pullrequest is waiting for your response. Please respond or the pullrequest will be closed.
Please note that in #5461 the collection repository was restructured to remove the directory tree in plugins/modules/, and the corresponding tree in tests/unit/plugins/modules/. Your PR modifies files in this directory structure, and unfortunately now has some conflicts, potentially because of this. Please rebase with the current main branch to remove the conflicts.
@dithotxgh You have not responded to information requests in this pullrequest so we will assume it no longer affects you. If you are still interested in this, please create a new pullrequest with the requested information.