diff options
author | Jordan Borean <jborean93@gmail.com> | 2019-11-13 12:47:12 +1000 |
---|---|---|
committer | Matt Davis <nitzmahone@users.noreply.github.com> | 2019-11-12 18:47:12 -0800 |
commit | 63b0ae494ec89a21517cb3e26e630550b754a37e (patch) | |
tree | ba383136e2f33cee6c960371b8413de92d24577c | |
parent | 39f83ce38c02a7483f497de2f1950f52bf2cb9af (diff) | |
download | ansible-63b0ae494ec89a21517cb3e26e630550b754a37e.tar.gz |
Improve handling of "restarted" state for win_iis_website module (#63829) (#64759)
* 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.yaml | 2 | ||||
-rw-r--r-- | lib/ansible/modules/windows/win_iis_website.ps1 | 2 |
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 c609372189..9eea6a1a37 100644 --- a/lib/ansible/modules/windows/win_iis_website.ps1 +++ b/lib/ansible/modules/windows/win_iis_website.ps1 @@ -138,7 +138,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 |