community / community.windows / 2.2.0 / module / win_firewall Enable or disable the Windows Firewall Authors: Michael Eaton (@michaeldeaton)community.windows.win_firewall (2.2.0) — module
Install with ansible-galaxy collection install community.windows:==2.2.0
collections: - name: community.windows version: 2.2.0
Enable or Disable Windows Firewall profiles.
- name: Enable firewall for Domain, Public and Private profiles community.windows.win_firewall: state: enabled profiles: - Domain - Private - Public tags: enable_firewall
- name: Disable Domain firewall community.windows.win_firewall: state: disabled profiles: - Domain tags: disable_firewall
- name: Enable firewall for Domain profile and block outbound connections community.windows.win_firewall: profiles: Domain state: enabled outbound_action: block tags: block_connection
state: choices: - disabled - enabled description: - Set state of firewall for given profile. type: str profiles: choices: - Domain - Private - Public default: - Domain - Private - Public description: - Specify one or more profiles to change. elements: str type: list inbound_action: choices: - allow - block - not_configured description: - Set to C(allow) or C(block) inbound network traffic in the profile. - C(not_configured) is valid when configuring a GPO. type: str version_added: 1.1.0 version_added_collection: community.windows outbound_action: choices: - allow - block - not_configured description: - Set to C(allow) or C(block) inbound network traffic in the profile. - C(not_configured) is valid when configuring a GPO. type: str version_added: 1.1.0 version_added_collection: community.windows
enabled: description: Current firewall status for chosen profile (after any potential change). returned: always sample: true type: bool profiles: description: Chosen profile. returned: always sample: Domain type: str state: description: Desired state of the given firewall profile(s). returned: always sample: enabled type: list