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.

Playbook

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
  tasks:
    - name: "Disable Windows Firewall"
      win_firewall:
        state: disabled
        profiles:
        - Domain
        - Private
        - Public
      tags: disable_firewall

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.