From f3d8cc0b18553c2f21e5704a6a61b828c89b2bad Mon Sep 17 00:00:00 2001 From: Rafael Alexandre <44480935+rafael-c-alexandre@users.noreply.github.com> Date: Fri, 18 Apr 2025 18:07:23 +0200 Subject: [PATCH] fix: rewrite ufw exceptions condition (#403) Signed-off-by: Rafael Alexandre --- roles/prereq/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/prereq/tasks/main.yml b/roles/prereq/tasks/main.yml index 2606dbb..a7c3aa8 100644 --- a/roles/prereq/tasks/main.yml +++ b/roles/prereq/tasks/main.yml @@ -42,7 +42,7 @@ - name: If ufw enabled, open api port when: - - ufw_status['stdout'] == "Status':' active" + - "'Status: active' in ufw_status['stdout']" community.general.ufw: rule: allow port: "{{ api_port }}" @@ -50,7 +50,7 @@ - name: If ufw enabled, open etcd ports when: - - ufw_status['stdout'] == "Status':' active" + - "'Status: active' in ufw_status['stdout']" - groups[server_group] | length > 1 community.general.ufw: rule: allow @@ -59,7 +59,7 @@ - name: If ufw enabled, allow default CIDRs when: - - ufw_status['stdout'] == "Status':' active" + - "'Status: active' in ufw_status['stdout']" community.general.ufw: rule: allow src: '{{ item }}'