ansible.windows.win_firewall_rule_info module – Gather information about Windows firewall rules
Note
This module is part of the ansible.windows collection (version 3.9.1).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install ansible.windows.
To use it in a playbook, specify: ansible.windows.win_firewall_rule_info.
Synopsis
Gathers detailed information about existing Windows firewall rules.
Allows filtering rules by display name or group name.
Parameters
Parameter |
Comments |
|---|---|
The group name to filter rules by. If omitted, rules will not be filtered by group. |
|
The rule’s display name to filter by. If omitted, rules will not be filtered by name. |
See Also
See also
- ansible.windows.win_firewall_rule
Windows firewall automation.
Examples
- name: Get information about a specific firewall rule
ansible.windows.win_firewall_rule_info:
name: http
register: http_rule_info
- name: Get information about all firewall rules in a specific group
ansible.windows.win_firewall_rule_info:
group: application
register: app_group_rules
- name: Get information about all firewall rules on the target host
ansible.windows.win_firewall_rule_info:
register: all_firewall_rules
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
List of firewall rules matching the specified criteria. Returned: always |
|
The action for the firewall rule (0 = block, 1 = allow). Returned: always Sample: |
|
Path to the executable/application associated with the rule, or null if applies to any. Returned: always Sample: |
|
Description of the firewall rule. Returned: always Sample: |
|
Traffic direction (1 = in, 2 = out). Returned: always Sample: |
|
Whether the firewall rule is enabled. Returned: always Sample: |
|
Group name the firewall rule belongs to. Returned: always Sample: |
|
Local IP addresses or ranges. Returned: always Sample: |
|
Local port numbers or ranges. Returned: always Sample: |
|
Display name of the firewall rule. Returned: always Sample: |
|
Bitmask representing active profiles (1 = Domain, 2 = Private, 4 = Public). Returned: always Sample: |
|
Protocol number associated with the rule (e.g. 6 for TCP, 17 for UDP). Returned: always Sample: |
|
Remote IP addresses or ranges. Returned: always Sample: |
|
Remote port numbers or ranges. Returned: always Sample: |
|
Service short name associated with the rule. Returned: always |