From b9d018885a21ee773cd636bf5dcbb51cb564dffe Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Wed, 5 Jul 2017 00:20:20 +0200 Subject: [PATCH] win_chocolatey: Ensure chocolatey to fail (#26416) Currently chocolatey is not failing when the user requests version X, but version X is not available in the repository. Obviously the module should fail in this case. This fixes #25393 --- lib/ansible/modules/windows/win_chocolatey.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/windows/win_chocolatey.ps1 b/lib/ansible/modules/windows/win_chocolatey.ps1 index 236a6c95f11..9ada67b5f13 100644 --- a/lib/ansible/modules/windows/win_chocolatey.ps1 +++ b/lib/ansible/modules/windows/win_chocolatey.ps1 @@ -157,7 +157,7 @@ Function Choco-Upgrade throw "$package is not installed, you cannot upgrade" } - $cmd = "$executable upgrade -dv -y $package -timeout $timeout" + $cmd = "$executable upgrade -dv -y $package -timeout $timeout --failonunfound" if ($check_mode) { @@ -269,7 +269,7 @@ Function Choco-Install } } - $cmd = "$executable install -dv -y $package -timeout $timeout" + $cmd = "$executable install -dv -y $package -timeout $timeout --failonunfound" if ($check_mode) {