From 115fb591363a0f9ec76ee6792cd7d67c463e3061 Mon Sep 17 00:00:00 2001 From: Timothy Vandenbrande Date: Tue, 30 Jun 2015 08:39:19 +0200 Subject: [PATCH] added the profile option + updated the docs for it --- lib/ansible/modules/extras/windows/win_fw.ps1 | 10 +++++++++- lib/ansible/modules/extras/windows/win_fw.py | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/windows/win_fw.ps1 b/lib/ansible/modules/extras/windows/win_fw.ps1 index 37e8935a23d..fcdf34799fc 100644 --- a/lib/ansible/modules/extras/windows/win_fw.ps1 +++ b/lib/ansible/modules/extras/windows/win_fw.ps1 @@ -202,7 +202,7 @@ if ((($direction.ToLower() -ne "In") -And ($direction.ToLower() -ne "Out")) -And $fwsettings.Add("Direction", $direction) }; if ((($action.ToLower() -ne "allow") -And ($action.ToLower() -ne "block")) -And ($state -eq "present")){ - $misArg+="Direction"; + $misArg+="Action"; $msg+=@("for the Action parameter only the values 'allow' and 'block' are allowed"); } else { $fwsettings.Add("Action", $action) @@ -225,6 +225,14 @@ foreach ($arg in $args){ }; }; +$profile=Get-Attr $params "profile" "all"; +if (($profile -ne 'current') -or ($profile -ne 'domain') -or ($profile -ne 'standard') -or ($profile -ne 'all') ) { + $misArg+="Profile"; + $msg+=@("for the Profile parameter only the values 'current', 'domain', 'standard' or 'all' are allowed"); +} else { + + $fwsettings.Add("profile", $profile) +} if ($($($misArg|measure).count) -gt 0){ $result=New-Object psobject @{ diff --git a/lib/ansible/modules/extras/windows/win_fw.py b/lib/ansible/modules/extras/windows/win_fw.py index 0566ef0608d..59e1918ff58 100644 --- a/lib/ansible/modules/extras/windows/win_fw.py +++ b/lib/ansible/modules/extras/windows/win_fw.py @@ -88,6 +88,11 @@ options: - the protocol this rule applies to default: null required: false + profile: + describtion: + - the profile this rule applies to + default: all + choices: ['current', 'domain', 'standard', 'all'] force: description: - Enforces the change if a rule with different values exists @@ -107,4 +112,4 @@ EXAMPLES = ''' action: allow protocol: TCP -''' \ No newline at end of file +'''