Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_iis_webapppool: do not output some cmdlet outputs #41884

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/win_iis_webapppool-output-fix.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions lib/ansible/modules/windows/win_iis_webapppool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ if ($state -eq "absent") {
if (-not $pool) {
if (-not $check_mode) {
try {
New-WebAppPool -Name $name
New-WebAppPool -Name $name > $null
} catch {
Fail-Json $result "Failed to create new Web App Pool $($name): $($_.Exception.Message)"
}
Expand Down Expand Up @@ -220,7 +220,7 @@ if ($state -eq "absent") {
}
foreach ($value in $new_value) {
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 {
Fail-Json -obj $result -message "Failed to add new attribute to Web App Pool $name. Attribute: $attribute_key, Value: $value, Exception: $($_.Exception.Message)"
}
Expand All @@ -241,7 +241,7 @@ if ($state -eq "absent") {
if ($state -eq "started" -or $state -eq "restarted") {
if (-not $check_mode) {
try {
Start-WebAppPool -Name $name
Start-WebAppPool -Name $name > $null
} catch {
Fail-Json $result "Failed to start Web App Pool $($name): $($_.Exception.Message)"
}
Expand All @@ -252,7 +252,7 @@ if ($state -eq "absent") {
if ($state -eq "stopped") {
if (-not $check_mode) {
try {
Stop-WebAppPool -Name $name
Stop-WebAppPool -Name $name > $null
} catch {
Fail-Json $result "Failed to stop Web App Pool $($name): $($_.Exception.Message)"
}
Expand All @@ -261,7 +261,7 @@ if ($state -eq "absent") {
} elseif ($state -eq "restarted") {
if (-not $check_mode) {
try {
Restart-WebAppPool -Name $name
Restart-WebAppPool -Name $name > $null
} catch {
Fail-Json $result "Failed to restart Web App Pool $($name): $($_.Exception.Message)"
}
Expand Down