---
- name: Detecting Atomic Host Operating System
  stat:
    path: /run/ostree-booted
    get_checksum: false
    get_attributes: false
    get_mime: false
  register: r_os_firewall_ostree_booted

- name: Set fact r_os_firewall_is_atomic
  set_fact:
    r_os_firewall_is_atomic: "{{ r_os_firewall_ostree_booted.stat.exists }}"

- include_tasks: firewalld.yml
  when:
  - os_firewall_enabled | bool
  - os_firewall_use_firewalld | bool

- include_tasks: iptables.yml
  when:
  - os_firewall_enabled | bool
  - not os_firewall_use_firewalld | bool
