-
Notifications
You must be signed in to change notification settings - Fork 456
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
Puppet repeatedly attempts to correct firewall rules when source
has a prefix length of zero
#1188
Comments
With Puppet 8.5.1, and module 8.0.0, firewall rules were not idempotent as well. To compensate, wherever
with
In addition, anywhere where I had used ranges in
with
After that, firewall rules were idempotent. In that regards PR #1189 was not necessary, in my case. Hope that helps someone. |
firewallchain resources with Puppet 8.5.1 and module version 8.0.0 are behaving non-idempotent for me, at the moment. To reproduce, try:
|
Here is the difference in debug output when executing:
With firewall v6.0.0:
With firewall v8.0.0:
|
@Ramesh7 : Any chance this issue can be looked at? I'm not sure how specs work in this module, but shouldn't |
Hey @corporate-gadfly, sorry for delay in response, I will have look in upcoming week on idempotent_apply. |
Hi @corporate-gadfly, I have tried on RHEL/Ubuntu and was able to reproduce the issue with given steps. Have dig more into that and here is my observations :
Later I tried to create a random chain and re-run the
After creating custom chain tried running same command :
Then tried rerunning same manifest which turn out to be idempotent :
Later I tried same on CentOS where have observed things are working as expected. Conclusion :
Please let me know if any questions or thoughts? |
@Ramesh7 thanks for looking into this, but I don't think @corporate-gadfly's |
@Ramesh7 Is there any update on this please? As per what @nabertrand said above this issue is separate to the issue that was fixed at #1206 |
I tested the latest version of 8.x today and this issue is still occurring. Can it be looked at and fixed please? There's an MR at #1189 |
Coming back to this issue, which still exists in the 8.x versions on Ubuntu 22, I asked, horror of all horrors, ChatGPT if there was a way to have the rules in the default tables show up. The helpful hint was to add placeholder rules and then remove them. E.g.:
followed by:
After this, Now, I know zilch about the Also, for reference, there is a netfilter bugzilla which mentions the sparseness of |
I did this as a workaround (I only have a few rules so it's not a big deal)
|
MR at #1189 has finally been merged so hopefully a release will be forthcoming also. |
@trevorrea : 8.1.3 has the fix. Are you able to test? My puppet control repository branch structure is preventing me from trying this, at the moment. |
If the firewall type
source
has a prefix length of zero, Puppet attempts to correct the source on every run.Environment details
Steps to reproduce:
Additional Information
When Puppet checks if
source
is in sync, it immediately returns nil becauseis
isnil
:puppetlabs-firewall/lib/puppet/provider/firewall/firewall.rb
Lines 328 to 329 in 403fed3
But when Puppet goes to apply the changes, it modifies the
should
to benil
because of the zero prefix length:puppetlabs-firewall/lib/puppet/provider/firewall/firewall.rb
Lines 871 to 873 in 403fed3
puppetlabs-firewall/lib/puppet_x/puppetlabs/firewall/utility.rb
Lines 89 to 90 in 403fed3
Potential Fix
Allow the
insync?
method to process thesource
anddestination
parameters before comparing so zero prefix length values become nil:The text was updated successfully, but these errors were encountered: