-
Notifications
You must be signed in to change notification settings - Fork 153
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 REJECT target name #215
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- firewalld - fix setting zone target to ``%%REJECT%%`` (https://github.com/ansible-collections/ansible.posix/pull/215). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hi @quasd, thanks for your contribution !
This replacement of
REJECT
by%%REJECT%%
doesn't make sense to me, so I'd rather ask firewalld developpers why they have implemented things this way. All that can be discussed in this PR is their fault :)Seriously, I'm not sure that staying close to firewalld semantic is the best way to follow for the module.
ACCEPT
,DROP
andREJECT
being the most common iptables targets, it makes sense to keep them as is.If firewall-cmd accepts both
REJECT
and%%REJECT%%
, does it make a difference in the results of firewalld-cmd ? If yes, then we have two reject targets, the naked one and the one with decoration. If no, then... "the simplest, the best" I would say. In other words, if a command called internally by the module needs%%REJECT%%
rather thanREJECT
, it is the job of the module to add these percent signs around the user input, which should beREJECT
I think.If decorations around REJECT raise questions (and it seems they do, here), and the only answer to these questions is
%%REJECT%%
just meansREJECT
, so please drop the decorations from user interface.Firewalld documentation says:
Also note that in iptables,
DROP
andACCEPT
can be used as rules targets as well as chain policies, whileREJECT
can't be used as a chain policy, but only as a rule target. That means that to get "every packet not matching any rule will be rejected" needs a final rule to do that, and is more difficult to manage than policies. That could explain why%%REJECT%%
and notREJECT
, and why%%REJECT%%
and not%%DROP%%
: the REJECT target behaves differently than the two others. Does it mean we have to write its name differently, as does firewalld ?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.
Hi guys,
Sorry if I made misunderstood that but there seem to be two types of
firewalld
targets(Zone targets and Policy targets) like below:As far as I know, the
target
option of thefirewalld
module is targetingZone
settings. And I have tried to launch the test playbook like below:Currently, if users specify
REJECT
as thetarget
value, thefirewall
module will be failed with the following traceback:We may need to continue to discuss the underlying design. But personally, I think this PR is reasonable to address the above current issue.
Thanks!
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.
thanks @saito-hideki for investigating on this !
So, now it's clear that
REJECT
and%%REJECT%%
don't have the same meaning.