ansible.builtin.win_firewall (v2.9.27) — module

Enable or disable the Windows Firewall

| "added in version" 2.4 of ansible.builtin"

Authors: Michael Eaton (@michaeldeaton)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Enable or Disable Windows Firewall profiles.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Enable firewall for Domain, Public and Private profiles
  win_firewall:
    state: enabled
    profiles:
    - Domain
    - Private
    - Public
  tags: enable_firewall
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Disable Domain firewall
  win_firewall:
    state: disabled
    profiles:
    - Domain
  tags: disable_firewall

Inputs

    
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.
    type: list

Outputs

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

See also