Disable Windows Firewall With Ansible

In this blog post, I will show you how to use Ansible and disable the Windows firewall on managed Windows machines.

Windows Firewall

By default, Windows firewall is enabled, and in some cases, you might need to disable it as part of a troubleshooting process or to allow a legacy application to work.


For that reason, Ansible has a module that allows us to manage and control the Windows Firewall on managed machines. Below is a playbook that will disable the firewall on all the profiles.

- name: "Windows Firewall"
  hosts: windows
    - name: "Disable Windows Firewall"
        state: disabled
        - Domain
        - Private
        - Public
      tags: disable_firewall

If you like to learn more about Ansible please visit the Ansible for Windows blog series.