Centos iso image doesn't have 'yum-utils' package with
'repoquery' binary which causes 'yum' module to crash.
Using more generic 'package_facts' fixes that.
This patch also introduces more general compatibility with
RedHat/Debian based distros.
Issue-ID: OOM-1632
Change-Id: Ica026c0f9a9ffa9e307f7cba589900962b0db4e7
Signed-off-by:  Bartek Grzybowski <b.grzybowski@partner.samsung.com>
   hosts: infrastructure, kubernetes
   roles:
     - role: firewall
-      vars:
-        state: disable
 
 - name: Setup infrastructure servers
   hosts: infrastructure
 
--- /dev/null
+---
+firewall:
+  state: disable
+  package_name:
+    RedHat: 'firewalld'
+    Debian: 'ufw'
 
 ---
-- name: Check if firewalld is installed
-  yum:
-    list: firewalld
-    disablerepo: "*"
-  register: firewalld_check
+- name: Get installed packages list
+  package_facts:
+    manager: "auto"
 
-- name: Stop and disable firewalld if exists
+- name: Stop and disable default OS firewall if exists
   service:
-    name: firewalld
+    name: "{{ firewall.package_name[ansible_facts.os_family] }}"
     state: stopped
     enabled: no
-  when: firewalld_check.results|selectattr('yumstate', 'match', 'installed')|list|length != 0
+  when: firewall.package_name[ansible_facts.os_family] in ansible_facts.packages
 
 - name: Flush iptables
   iptables:
 
 ---
-- include_tasks: "firewall-{{ state }}.yml"
+- include_tasks: "firewall-{{ firewall.state }}.yml"