From 2106581fa0c488aa83c8cee3dd8df0e07bce015f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de>
Date: Tue, 9 Apr 2024 16:17:19 +0200
Subject: [PATCH] fix: use ansible.builtin.shell instead of
 ansible.builtin.command to be able to use Shell redirection for saving
 iptables rules

---
 handlers/main.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/handlers/main.yml b/handlers/main.yml
index 546c8d4..bfc82d4 100644
--- a/handlers/main.yml
+++ b/handlers/main.yml
@@ -32,7 +32,9 @@
         mode: "0600"
       listen: "save iptables rules"
     - name: save iptables rules
-      ansible.builtin.command:
+      # We need to use ansible.builtin.shell here to be able to use Shell
+      # redirection.
+      ansible.builtin.shell:
         cmd: /usr/sbin/iptables-save > /etc/sysconfig/iptables        # noqa command-instead-of-module
       listen: "save iptables rules"
       changed_when: false
-- 
GitLab