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

Enable or disable the Windows Firewall

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

Authors: Michael Eaton (@if-meaton)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.5.15

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:
    - enabled
    - disabled
    description:
    - Set state of firewall for given profile.

profiles:
    choices:
    - Domain
    - Private
    - Public
    default:
    - Domain
    - Private
    - Public
    description:
    - Specify one or more profiles to change.

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: string
state:
  description: desired state of the given firewall profile(s)
  returned: always
  sample: enabled
  type: list