1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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.
This commit is contained in:
Andrea Scarpino 2016-04-12 14:07:32 +02:00 committed by Matt Clay
parent 26fe35fd0c
commit b4064a352e
2 changed files with 3 additions and 1 deletions

View file

@ -212,6 +212,7 @@ $action=Get-Attr $params "action" "";
$misArg = '' $misArg = ''
# Check the arguments # Check the arguments
if ($enable -ne $null) { if ($enable -ne $null) {
$enable=ConvertTo-Bool $enable;
if ($enable -eq $true) { if ($enable -eq $true) {
$fwsettings.Add("Enabled", "yes"); $fwsettings.Add("Enabled", "yes");
} elseif ($enable -eq $false) { } elseif ($enable -eq $false) {

View file

@ -114,10 +114,11 @@ EXAMPLES = '''
action: win_firewall_rule action: win_firewall_rule
args: args:
name: smtp name: smtp
enabled: yes enable: yes
state: present state: present
localport: 25 localport: 25
action: allow action: allow
direction: In
protocol: TCP protocol: TCP
''' '''