-
Notifications
You must be signed in to change notification settings - Fork 33
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
forward_ports not persistent #234
Comments
Try to debug and reproduce linux-system-roles#234
@rlenferink I'm trying to reproduce this issue. I have added a test which I think does exactly what you have described: https://github.com/linux-system-roles/firewall/pull/237/files But I cannot reproduce your results: https://dl.fedoraproject.org/pub/alt/linuxsystemroles/logs/tf_firewall-237_CentOS-Stream-8-2.16_20241015-223409/artifacts/tests_issue_234-ANSIBLE-2.16-general-SUCCESS.log
Am I missing something? |
…her elements are already changed This fixes linux-system-roles#234
@richm thanks for thinking along and investigating this! I tried to replicate this locally using your suggested playbook, and was eventually able to do so (see https://github.com/rlenferink/ansible-firewall-role-test) The problem why you (and I) were initially unable to reproduce the problem, was that when a non-existing interface is defined, everything works fine. However, when an existing interface is defined (this is expected behavior), the firewall/library/firewall_lib.py Lines 1551 to 1559 in dd6bdeb
This resulted in changes only being applied runtime and not permanent. I couldn't really think on a proper way to add a test for this, since I think what you were trying to do in #237 was to be able to reproduce/debug it and then look at the logging for problem analysis, or is the intention of that PR to merge and prevent regression later on? |
Correct. Trying to reproduce the behavior you reported.
I would really like to add a regression test for this case, ideally as part of #241, but I can add a test after your PR too. |
here is the regression test - #241 (comment) |
…her elements are already changed This fixes linux-system-roles#234
What happened:
I am using the firewall role with the following definition:
What you expected to happen:
I expected because of the
permanent
flag that theforward_port
s would also be persistent. The rest of the firewall configuration is persistent (if noforward_port
s are specified), however when forward_ports are specified, the configuration is lost after areboot
of the target node.I verified this with
firewall-cmd --list-all-zones
. It seems that the forward_ports are gone, and if there is a forward_port specified that the 'normal' ports are also gone.How to reproduce it (as minimally and precisely as possible):
Use e.g. the snipped above.
Anything else we need to know?:
Environment:
dnf info firewalld
or commit hash if developing from gitgit log -n1 --format=format:"%H"
):cat /etc/firewalld/firewalld.conf | grep FirewallBackend
): 0.9.11ansible --version
): 2.16.5ansible-galaxy list | grep linux-system-roles.firewall
or commit hash if developing from gitgit log -n1 --format=format:"%H"
): 4c4a134cat /etc/os-release
): Rocky Linux 8.10The text was updated successfully, but these errors were encountered: