summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2019-11-13 12:46:54 +1000
committerMatt Davis <nitzmahone@users.noreply.github.com>2019-11-12 18:46:54 -0800
commit65ab51082b2b202f6cf51d8ce4b383fb7732319e (patch)
tree3fadee3a18f496039ded33726be5f05caf85589b
parent25f8d0dcd315da398807e1b3efed222df309cd23 (diff)
downloadansible-65ab51082b2b202f6cf51d8ce4b383fb7732319e.tar.gz
Improve handling of "restarted" state for win_iis_website module (#63829) (#64760)
* Improve handling of "restarted" state for win_iis_website module * Added changelog fragment (cherry picked from commit bd9a0b6700d2f54185d84a772a21605e67f7e077)
-rw-r--r--changelogs/fragments/win_iis_website-restarted.yaml2
-rw-r--r--lib/ansible/modules/windows/win_iis_website.ps12
2 files changed, 3 insertions, 1 deletions
diff --git a/changelogs/fragments/win_iis_website-restarted.yaml b/changelogs/fragments/win_iis_website-restarted.yaml
new file mode 100644
index 0000000000..22f843995f
--- /dev/null
+++ b/changelogs/fragments/win_iis_website-restarted.yaml
@@ -0,0 +1,2 @@
+bugfixes:
+- win_iis_website - Actually restart the site when ``state=restarted`` - https://github.com/ansible/ansible/issues/63828
diff --git a/lib/ansible/modules/windows/win_iis_website.ps1 b/lib/ansible/modules/windows/win_iis_website.ps1
index 7986baa861..e7b6cab8bf 100644
--- a/lib/ansible/modules/windows/win_iis_website.ps1
+++ b/lib/ansible/modules/windows/win_iis_website.ps1
@@ -143,7 +143,7 @@ Try {
}
# Set run state
- if (($state -eq 'stopped') -and ($site.State -eq 'Started'))
+ if ((($state -eq 'stopped') -or ($state -eq 'restarted')) -and ($site.State -eq 'Started'))
{
Stop-Website -Name $name -ErrorAction Stop
$result.changed = $true