mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
* Update core modules to fix strict mode errors. * Also fix creates parameter issue in win_msi as described in https://github.com/ansible/ansible-modules-core/issues/129, slightly different fix from https://github.com/ansible/ansible-modules-core/pull/1482 * Fix setup.ps1 module issue described in https://github.com/ansible/ansible-modules-core/issues/1927
This commit is contained in:
parent
6f36629d13
commit
9ed0a5a920
7 changed files with 65 additions and 125 deletions
|
@ -27,48 +27,18 @@ $result = New-Object psobject @{
|
|||
changed = $false
|
||||
}
|
||||
|
||||
If ($params.name) {
|
||||
$name = $params.name -split ',' | % { $_.Trim() }
|
||||
}
|
||||
Else {
|
||||
Fail-Json $result "mising required argument: name"
|
||||
$name = Get-Attr $params "name" -failifempty $true
|
||||
$name = $name -split ',' | % { $_.Trim() }
|
||||
|
||||
$state = Get-Attr $params "state" "present"
|
||||
$state = $state.ToString().ToLower()
|
||||
If (($state -ne 'present') -and ($state -ne 'absent')) {
|
||||
Fail-Json $result "state is '$state'; must be 'present' or 'absent'"
|
||||
}
|
||||
|
||||
If ($params.state) {
|
||||
$state = $params.state.ToString().ToLower()
|
||||
If (($state -ne 'present') -and ($state -ne 'absent')) {
|
||||
Fail-Json $result "state is '$state'; must be 'present' or 'absent'"
|
||||
}
|
||||
}
|
||||
Elseif (!$params.state) {
|
||||
$state = "present"
|
||||
}
|
||||
|
||||
If ($params.restart) {
|
||||
$restart = $params.restart | ConvertTo-Bool
|
||||
}
|
||||
Else
|
||||
{
|
||||
$restart = $false
|
||||
}
|
||||
|
||||
if ($params.include_sub_features)
|
||||
{
|
||||
$includesubfeatures = $params.include_sub_features | ConvertTo-Bool
|
||||
}
|
||||
Else
|
||||
{
|
||||
$includesubfeatures = $false
|
||||
}
|
||||
|
||||
if ($params.include_management_tools)
|
||||
{
|
||||
$includemanagementtools = $params.include_management_tools | ConvertTo-Bool
|
||||
}
|
||||
Else
|
||||
{
|
||||
$includemanagementtools = $false
|
||||
}
|
||||
$restart = Get-Attr $params "restart" $false | ConvertTo-Bool
|
||||
$includesubfeatures = Get-Attr $params "include_sub_features" $false | ConvertTo-Bool
|
||||
$includemanagementtools = Get-Attr $params "include_management_tools" $false | ConvertTo-Bool
|
||||
|
||||
$name = $name.split(",")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue