From 38cb5c61305624e8eb795fe4cb7a0c07ed09e40c 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. --- windows/win_firewall_rule.ps1 | 1 + windows/win_firewall_rule.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/windows/win_firewall_rule.ps1 b/windows/win_firewall_rule.ps1 index 63ac538e376..21f96bcf33f 100644 --- a/windows/win_firewall_rule.ps1 +++ b/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/windows/win_firewall_rule.py b/windows/win_firewall_rule.py index 03611a60ef4..2f90e2a6730 100644 --- a/windows/win_firewall_rule.py +++ b/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 '''