win_firewall - Enable or disable the Windows Firewall

New in version 2.4.

Synopsis

  • Enable or Disable Windows Firewall profiles.

Requirements (on host that executes module)

  • This module requires Windows Management Framework 5 or later.

Options

parameter required default choices comments
profiles
no [u'Domain', u'Private', u'Public']
  • Domain
  • Private
  • Public
Specify one or more profiles to change.
state
no
  • enabled
  • disabled
Set state of firewall for given profile.

Examples

- name: Enable firewall for Domain, Public and Private profiles
  win_firewall:
    state: enabled
    profiles:
    - Domain
    - Private
    - Public
  tags: enable_firewall

- name: Disable Domain firewall
  win_firewall:
    state: disabled
    profiles:
    - Domain
  tags: disable_firewall

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
enabled
current firewall status for chosen profile (after any potential change)
always bool True
profiles
chosen profile
always string Domain
state
desired state of the given firewall profile(s)
always list enabled

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/win_firewall_module.html