win_firewall_rule – Windows firewall automation
win_firewall_rule – Windows firewall automation
New in version 2.0.
Synopsis
- Allows you to create/remove/update firewall rules.
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
action string |
|
What to do with the items this rule is for. Defaults to |
description string |
Description for the firewall rule. | |
direction string |
|
Whether this rule is for inbound or outbound traffic. Defaults to |
enabled boolean |
|
Whether this firewall rule is enabled or disabled. Defaults to
|
force boolean |
|
Replace any existing rule by removing it first. This is no longer required in Ansible 2.4 as rules no longer need replacing when being modified. DEPRECATED in Ansible 2.4 and will be removed in Ansible 2.9. |
localip string |
The local ip address this rule applies to. Set to Defaults to | |
localport string |
The local port this rule applies to. Set to Defaults to | |
name string / required |
The rule's display name. | |
profiles list |
The profile this rule applies to. Defaults to
| |
program string |
The program this rule applies to. Set to Defaults to | |
protocol string |
The protocol this rule applies to. Set to Defaults to | |
remoteip string |
The remote ip address/range this rule applies to. Set to Defaults to | |
remoteport string |
The remote port this rule applies to. Set to Defaults to | |
service string |
The service this rule applies to. Set to Defaults to | |
state string |
|
Should this rule be added or removed. |
See Also
See also
- win_firewall – Enable or disable the Windows Firewall
- The official documentation on the win_firewall module.
Examples
- name: Firewall rule to allow SMTP on TCP port 25
win_firewall_rule:
name: SMTP
localport: 25
action: allow
direction: in
protocol: tcp
state: present
enabled: yes
- name: Firewall rule to allow RDP on TCP port 3389
win_firewall_rule:
name: Remote Desktop
localport: 3389
action: allow
direction: in
protocol: tcp
profiles: private
state: present
enabled: yes
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors
- Artem Zinenko (@ar7z1)
- Timothy Vandenbrande (@TimothyVandenbrande)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.8/modules/win_firewall_rule_module.html