Skip to content

Commit

Permalink
Return condition to test firewalld service state
Browse files Browse the repository at this point in the history
After the #11868 the condition to test the firewalld service state was
removed, causing the remediation to report error when the service is stopped.
This change also created a misalignment with Ansible remediation.
This commit returns the condition to keep the alignment and better
report the case to users.
  • Loading branch information
marcusburghardt committed Apr 26, 2024
1 parent 7975306 commit 7bb12ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ ipv6_rule='rule family=ipv6 source address="::1" destination not address="::1" d
if {{{ in_chrooted_environment }}}; then
firewall-offline-cmd --zone=trusted --add-rich-rule="${ipv4_rule}"
firewall-offline-cmd --zone=trusted --add-rich-rule="${ipv6_rule}"
else
elif systemctl is-active firewalld; then
firewall-cmd --permanent --zone=trusted --add-rich-rule="${ipv4_rule}"
firewall-cmd --permanent --zone=trusted --add-rich-rule="${ipv6_rule}"
firewall-cmd --reload
else
echo "
firewalld service is not active. Remediation aborted!
This remediation could not be applied because it depends on firewalld service running.
The service is not started by this remediation in order to prevent connection issues."
fi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

if {{{ in_chrooted_environment }}}; then
firewall-offline-cmd --zone=trusted --add-interface=lo
else
elif systemctl is-active firewalld; then
firewall-cmd --permanent --zone=trusted --add-interface=lo
firewall-cmd --reload
else
echo "
firewalld service is not active. Remediation aborted!
This remediation could not be applied because it depends on firewalld service running.
The service is not started by this remediation in order to prevent connection issues."
fi

0 comments on commit 7bb12ce

Please sign in to comment.