Skip to content
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

test: restart firewalld before checking ports status #412

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/tasks/check_firewall_selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
- name: Check firewall port status
when: logging_manage_firewall | bool
block:
# not sure what tests_imuxsock is doing on el10, but it leaves firewalld
# in a strange state such that it cannot connect to dbus and gives
# ERROR: Exception DBusException: org.freedesktop.DBus.Error.AccessDenied: Request to own name refused by policy
# restarting firewalld here seems to clear that state.
- name: Restart firewall to clear error state
service:
name: firewalld
state: restarted

- name: Check firewall port status (manage - tcp)
shell: |
set -euo pipefail
Expand All @@ -29,6 +38,15 @@
loop: "{{ logging_tls_udp_ports + logging_udp_ports }}"
when:
- (logging_tls_udp_ports + logging_udp_ports) | d([]) | length > 0
rescue:
- name: Debug errors
shell: |
set -x
exec 1>&2
systemctl status firewalld || :
grep type=AVC /var/log/audit/audit.log || :
failed_when: true
changed_when: false

- name: Check SELinux port status
when: logging_manage_selinux | bool
Expand Down
Loading