From b4064a352e0c3838f5075f1020b6bdfcaea14f5d Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Tue, 12 Apr 2016 14:07:32 +0200 Subject: [PATCH] The enable parameter is a boolean, then convert to a boolean. (#1607) At the moment, this only works when 'enable' is equals to 'yes' or 'no'. While I'm on it, I also fixed a typo in the example and added a required parameter. --- lib/ansible/modules/extras/windows/win_firewall_rule.ps1 | 1 + lib/ansible/modules/extras/windows/win_firewall_rule.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/windows/win_firewall_rule.ps1 b/lib/ansible/modules/extras/windows/win_firewall_rule.ps1 index 63ac538e37..21f96bcf33 100644 --- a/lib/ansible/modules/extras/windows/win_firewall_rule.ps1 +++ b/lib/ansible/modules/extras/windows/win_firewall_rule.ps1 @@ -212,6 +212,7 @@ $action=Get-Attr $params "action" ""; $misArg = '' # Check the arguments if ($enable -ne $null) { + $enable=ConvertTo-Bool $enable; if ($enable -eq $true) { $fwsettings.Add("Enabled", "yes"); } elseif ($enable -eq $false) { diff --git a/lib/ansible/modules/extras/windows/win_firewall_rule.py b/lib/ansible/modules/extras/windows/win_firewall_rule.py index 03611a60ef..2f90e2a673 100644 --- a/lib/ansible/modules/extras/windows/win_firewall_rule.py +++ b/lib/ansible/modules/extras/windows/win_firewall_rule.py @@ -114,10 +114,11 @@ EXAMPLES = ''' action: win_firewall_rule args: name: smtp - enabled: yes + enable: yes state: present localport: 25 action: allow + direction: In protocol: TCP '''