diff options
author | Matt Martz <matt@sivel.net> | 2014-06-18 13:32:58 -0500 |
---|---|---|
committer | Matt Martz <matt@sivel.net> | 2014-06-19 14:25:27 -0500 |
commit | 069fa71d873409ba97506465605f312b45557894 (patch) | |
tree | 1f0370fdb474beff447ac15d8cfed6099254f9c8 | |
parent | 5d7f67569fab3e5805fe8076c3f2edf1895bb26d (diff) | |
download | ansible-069fa71d873409ba97506465605f312b45557894.tar.gz |
Remove unneeded code, document creates param and ensure creates only affects state=present
-rw-r--r-- | library/windows/win_msi | 7 | ||||
-rw-r--r-- | library/windows/win_msi.ps1 | 10 |
2 files changed, 7 insertions, 10 deletions
diff --git a/library/windows/win_msi b/library/windows/win_msi index 894d7e2fc7..9eb6f1bafa 100644 --- a/library/windows/win_msi +++ b/library/windows/win_msi @@ -27,7 +27,8 @@ module: win_msi version_added: "1.7" short_description: Installs and uninstalls Windows MSI files description: - - Installs or uninstalls a Windows MSI file that is already located on the target server + - Installs or uninstalls a Windows MSI file that is already located on the + target server options: path: description: @@ -40,6 +41,10 @@ options: - present - absent default: present + creates: + description: + - Path to a file created by installing the MSI to prevent from + attempting to reinstall the package on every run author: Matt Martz ''' diff --git a/library/windows/win_msi.ps1 b/library/windows/win_msi.ps1 index d28ae85bd7..1c2bc8a301 100644 --- a/library/windows/win_msi.ps1 +++ b/library/windows/win_msi.ps1 @@ -35,7 +35,7 @@ If ($params.extra_args.GetType) $extra_args = $params.extra_args; } -If ($params.creates.GetType) +If ($params.creates.GetType -and $params.state.GetType -and $params.state -ne "absent") { If (Test-File $creates) { @@ -44,8 +44,6 @@ If ($params.creates.GetType) } $logfile = [IO.Path]::GetTempFileName(); -$stdoutfile = [IO.Path]::GetTempFileName(); -$stderrfile = [IO.Path]::GetTempFileName(); if ($params.state.GetType -and $params.state -eq "absent") { msiexec.exe /x $params.path /qb /l $logfile $extra_args; @@ -59,13 +57,7 @@ Set-Attr $result "changed" $true; $logcontents = Get-Content $logfile; Remove-Item $logfile; -$stdoutcontents = Get-Content $stdoutfile; -Remove-Item $stdoutfile; -$stderrcontents = Get-Content $stderrfile; -Remove-Item $stderrfile; Set-Attr $result "log" $logcontents; -Set-Attr $result "stdout" $stdoutcontents; -Set-Attr $result "stderr" $stderrcontents; Exit-Json $result; |