allow using --check on win_iis_webapppool module (#50528)

* allow using --check on win_iis_webapppool module

* Added changelog and slight logic tweak

* Fix typo in changelog fragment
This commit is contained in:
Tony Chia 2019-11-13 14:52:34 -08:00 committed by Jordan Borean
parent 3a9650df98
commit 23a751323b
2 changed files with 57 additions and 52 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- win_iis_webapppool - Do not try and set attributes in check mode when the pool did not exist

View file

@ -201,6 +201,8 @@ if ($state -eq "absent") {
}
}
# Cannot run the below in check mode if the pool did not always exist
if ($pool) {
# Modify pool based on parameters
foreach ($attribute in $attributes.GetEnumerator()) {
$attribute_key = $attribute.Name
@ -269,6 +271,7 @@ if ($state -eq "absent") {
$result.changed = $true
}
}
}
}
# Get all the current attributes for the pool