--- - name: Install Redis Database ansible.builtin.dnf: name: redis state: present - name: Configure Redis to listen on all IPs ansible.builtin.lineinfile: path: /etc/redis/redis.conf regexp: '^bind ' line: 'bind 0.0.0.0' - name: Enable and start the redis service ansible.builtin.service: name: redis state: started enabled: true - name: Gather facts from client systems ansible.builtin.setup: delegate_to: "{{ item }}" delegate_facts: true loop: "{{ groups[redis_clients_group] }}" - name: Ensure Firewall is enabled ansible.builtin.systemd: name: firewalld.service state: started enabled: true - name: Open the Firewall ansible.posix.firewalld: rich_rule: 'rule family="ipv4" source address="{{ item }}/32" port protocol="tcp" port="6379" accept' permanent: true state: enabled immediate: true loop: "{{ groups[redis_clients_group] | map('extract', hostvars, ['ansible_facts', 'default_ipv4', 'address']) | list }}"