Skip to content

firewalld_info

Collection Note

This module is part of the ansible.posix collection. To install the collection, use:

ansible-galaxy collection install ansible.posix

You need further requirements to be able to use this module, see the Requirements section for details.

Synopsis

  • This module gathers information about firewalld rules.

Requirements

The following Python packages are needed on the host that executes this module:

Parameters

Parameter Defaults / Choices Comments
active_zones
bool
Gather information about active zones.
zones
list / elements=str
Gather information about specific zones.
If only works if O(active_zones=false).

Examples

- name: Gather information about active zones
  ansible.posix.firewalld_info:
    active_zones: true
  register: result

- name: Print default zone for debugging
  ansible.builtin.debug:
    var: result.firewalld_info.default_zone

- name: Gather information about specific zones
  ansible.posix.firewalld_info:
    zones:
      - public
      - external
      - internal
  register: result

Return Values

Key Data Type Description Returned
active_zones bool Gather active zones only if turn it C(true). success
collected_zones list A list of collected zones. success
firewalld_info complex Returns various information about firewalld configuration. success
undefined_zones list A list of undefined zones in C(zones) option. C(undefined_zones) will be ignored for gathering process. success

Authors

  • Hideki Saito (@saito-Hideki)