Install Windows Identity Extensions with ansible/Chocolatey

Hello

I hit a problem when trying to install Windows Identity Extensions with ansible/chocolatey. (ansible 2.8.1)

I created an package for Windows Identity extensions:

The .nuspec

<?xml version="1.0"?>

MicrosoftIdentityExtensions_x64

1.0

MicrosoftIdentityExtensions_x64

Name

Microsoft

false

Windows Identity Extensions

Windows Identity Extensions

MicrosoftIdentityExtensions_x64

tools/chocolateyInstall.ps1:

$packageArgs = @{

packageName = ‘MicrosoftIdentityExtensions-64.msi’

fileType = ‘msi’

url = ‘https://download.microsoft.com/download/0/1/D/01D06854-CA0C-46F1-ADBA-EBF86010DCC6/rtm/MicrosoftIdentityExtensions-64.msi

checksum = ‘775AF844A832FB3B7A478B89880B7F09FAAC4772A029E7D55681A7E7EBB2270F’

checksumType = ‘sha256’

silentArgs = ‘/quiet IACCEPTSQLNCLILICENSETERMS=YES’

validExitCodes = @(0)

softwareName = ‘Windows Identity Extensions’

}

Install-ChocolateyPackage @packageArgs

When use ansible/chocolatey to install this package:

  • name: Install Windows Identity Extensions

win_chocolatey:

name: MicrosoftIdentityExtensions_x64

source: http://local_repository/

state: present

The exit code 0 which indicated the successful installation of the package, however, It only copied the target file(s) to target location, the package is NOT showing up in control panel on target server.

When call choco command locally to install this package:

choco install -s “http://local_repository/” MicrosoftIdentityExtensions_x64 -y

the exit code is 0 and package is installed successfully .

Please help to debug

If the package is returning 0 but not actually installing itself you need to find out why, the usual case is that you are running over WinRM which does change the behaviour slightly. Unfortunately Chocolatey is mostly a black box in Ansible, all the module does is calls ‘choco install …’. What I would do is;

  • Use ‘win_command: choco install -s “http://local_repository/” MicrosoftIdentityExtensions_x64 -y"’ to see if that works
  • Modify your package so the call to msiexec outputs the log file [1]
  • Try and install it manually with win_command
  • ‘win_command: msiexec /i C:\path\to\MicrosoftIdentityExtensions_x64.msi’- Check for any Chocolatey logs to see if has anything that could indicate why it didn’t install
  • Use become [2] on your win_chocolatey step and see if that works

[1] - https://www.advancedinstaller.com/user-guide/qa-log.html
[2] - https://docs.ansible.com/ansible/latest/user_guide/become.html#become-and-windows

Thanks

Jordan

Hi Jordan,

Thank you for point me to the right direction, I have compared msi output file, found that

msiexec /i C:\path\to\MicrosoftIdentityExtensions_x64.msi only do the installation for current user , msiexec /i ALLUSERS=“1” C:\path\to\MicrosoftIdentityExtensions_x64.msi do the installation for all users.