mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
win_iis_webapppool: do not output some cmdlet outputs (#41884)
This commit is contained in:
parent
895c512596
commit
abfcc35e6f
2 changed files with 7 additions and 5 deletions
2
changelogs/fragments/win_iis_webapppool-output-fix.yml
Normal file
2
changelogs/fragments/win_iis_webapppool-output-fix.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- win_iis_webapppool - redirect some module output to null so Ansible can read the output JSON https://github.com/ansible/ansible/issues/40874
|
|
@ -189,7 +189,7 @@ if ($state -eq "absent") {
|
||||||
if (-not $pool) {
|
if (-not $pool) {
|
||||||
if (-not $check_mode) {
|
if (-not $check_mode) {
|
||||||
try {
|
try {
|
||||||
New-WebAppPool -Name $name
|
New-WebAppPool -Name $name > $null
|
||||||
} catch {
|
} catch {
|
||||||
Fail-Json $result "Failed to create new Web App Pool $($name): $($_.Exception.Message)"
|
Fail-Json $result "Failed to create new Web App Pool $($name): $($_.Exception.Message)"
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ if ($state -eq "absent") {
|
||||||
}
|
}
|
||||||
foreach ($value in $new_value) {
|
foreach ($value in $new_value) {
|
||||||
try {
|
try {
|
||||||
New-ItemProperty -Path IIS:\AppPools\$name -Name $attribute_key -Value @{value=$value} -WhatIf:$check_mode
|
New-ItemProperty -Path IIS:\AppPools\$name -Name $attribute_key -Value @{value=$value} -WhatIf:$check_mode > $null
|
||||||
} catch {
|
} catch {
|
||||||
Fail-Json -obj $result -message "Failed to add new attribute to Web App Pool $name. Attribute: $attribute_key, Value: $value, Exception: $($_.Exception.Message)"
|
Fail-Json -obj $result -message "Failed to add new attribute to Web App Pool $name. Attribute: $attribute_key, Value: $value, Exception: $($_.Exception.Message)"
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ if ($state -eq "absent") {
|
||||||
if ($state -eq "started" -or $state -eq "restarted") {
|
if ($state -eq "started" -or $state -eq "restarted") {
|
||||||
if (-not $check_mode) {
|
if (-not $check_mode) {
|
||||||
try {
|
try {
|
||||||
Start-WebAppPool -Name $name
|
Start-WebAppPool -Name $name > $null
|
||||||
} catch {
|
} catch {
|
||||||
Fail-Json $result "Failed to start Web App Pool $($name): $($_.Exception.Message)"
|
Fail-Json $result "Failed to start Web App Pool $($name): $($_.Exception.Message)"
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ if ($state -eq "absent") {
|
||||||
if ($state -eq "stopped") {
|
if ($state -eq "stopped") {
|
||||||
if (-not $check_mode) {
|
if (-not $check_mode) {
|
||||||
try {
|
try {
|
||||||
Stop-WebAppPool -Name $name
|
Stop-WebAppPool -Name $name > $null
|
||||||
} catch {
|
} catch {
|
||||||
Fail-Json $result "Failed to stop Web App Pool $($name): $($_.Exception.Message)"
|
Fail-Json $result "Failed to stop Web App Pool $($name): $($_.Exception.Message)"
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ if ($state -eq "absent") {
|
||||||
} elseif ($state -eq "restarted") {
|
} elseif ($state -eq "restarted") {
|
||||||
if (-not $check_mode) {
|
if (-not $check_mode) {
|
||||||
try {
|
try {
|
||||||
Restart-WebAppPool -Name $name
|
Restart-WebAppPool -Name $name > $null
|
||||||
} catch {
|
} catch {
|
||||||
Fail-Json $result "Failed to restart Web App Pool $($name): $($_.Exception.Message)"
|
Fail-Json $result "Failed to restart Web App Pool $($name): $($_.Exception.Message)"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue