Add feature - win_package - allow non-zero return codes - Issue #20408 (#20410)

pull/20738/head
JimFicarra 8 years ago committed by Matt Davis
parent 5503b89831
commit 2a27176d7c

@ -850,6 +850,7 @@ function Set-TargetResource
if($process)
{
$exitCode = $process.ExitCode
Set-Attr -obj $result -name "exit_code" -value $exitCode
}
}
}

@ -74,6 +74,12 @@ options:
- Password of an account with access to the package if it's located on a file share. Only needed if the winrm user doesn't have access to the package. Also specify user_name for this to function properly.
default: null
required: false
expected_return_code:
description:
- One or more return codes from the package installation that indicates success.
- If not provided, defaults to 0
required: no
default: 0
'''
EXAMPLES = r'''
@ -94,4 +100,24 @@ EXAMPLES = r'''
path: https://download.microsoft.com/download/A/F/0/AF0071F3-B198-4A35-AA90-C68D103BDCCF/rdcman.msi
product_id: '{0240359E-6A4C-4884-9E94-B397A02D893C}'
state: absent
# Specify the expected non-zero return code when successful
# In this case 3010 indicates 'reboot required'
- name: 'Microsoft .NET Framework 4.5.1'
win_package:
path: https://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe
productid: '{7DEBE4EB-6B40-3766-BB35-5CBBC385DA37}'
arguments: '/q /norestart'
ensure: present
expected_return_code: 3010
# Specify multiple non-zero return codes when successful
# In this case we can say that both 0 (SUCCESSFUL) and 3010 (REBOOT REQUIRED) codes are acceptable
- name: 'Microsoft .NET Framework 4.5.1'
win_package:
path: https://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe
productid: '{7DEBE4EB-6B40-3766-BB35-5CBBC385DA37}'
arguments: '/q /norestart'
ensure: present
expected_return_code: [0,3010]
'''

Loading…
Cancel
Save