How to get facts about firewall type?

Hi,

I have a lot of centos7 webservers with firewalld onboard and a lot of centos7 webservers with iptables onboard and i need to write role webserves, some parts are differ to different firewall type.

Is a simple way to get fact about firewall presence (installed or not) and its type (firewalld/iptables) or i need to input this info manually into variables?

Doesn’t work that way today, but that sounds like an awesome enhancement to the facts module… #lowhangingfruit

+1

But using a pre-task testing for /etc/firewalld, systemctl status
firewalld or /etc/sysconfig/iptables-config should do the trick...

Johannes