Open MaKaNu opened 4 months ago
Thanks for the issue, unfortunately there isn't too much we can do without access to try and replicate the problem. It could be a myriad of problems but I'll try and explain how win_product
work and maybe that can help identify what is going wrong.
The module will invoke the executable given with the arguments and will wait for the process to finish. It will then check the return code to see if it is 0 or not and is used as the basic check to see if it worked. The module then exits normally and returns the result back to ansible.
In the past I have seen reports where the installed process somehow inherited the same console that the module was running under and stopped it from closing when the module has ended but that would cause the module to hang rather than return. You could try using wait_for_children: true but that will block until the installer and any processes it starts to finish before returning back.
You could try installing your application with become
to potentially rule out any problems related to a network problem
- ansible.windows.win_package:
path: 'C:\TEMP\ads_2023_update1.exe'
product_id: 'Advanced Design System 2023 Update 1'
state: present
arguments: '-f C:\TEMP\installer.properties -i silent'
become: true
become_method: runas
vars:
ansible_become_user: '{{ ansible_user }}'
ansible_become_pass: '{{ ansible_password }}'
If that doesn't work the next steps is to figure out what the installer is doing and why it doesn't work in Ansible. You could tell the developer they can replicate how Ansible runs the installer by using Invoke-Command
on Windows:
Invoke-Command -ComputerName target -ScriptBlock {
$proc = Start-Process -FileName 'C:\TEMP\ads_2023_update1.exe' -ArgumentList '-f C:\TEMP\installer.properties -i silent' -PassThru
$proc | Wait-Process
if ($proc.ExitCode) {
throw "Proc failed with $($proc.ExitCode)"
}
}
SUMMARY
We have software from keysight, which we want to install on our workstations. Their software is installed via "InstallAnywhere". Sadly Keysight has no ansible experience and so they could not help. The installation can be triggered via silent install, but behaves differently if I install it from powershell or via ansible.
It seems that the processes are not finished correctly.
ISSUE TYPE
COMPONENT NAME
win_package
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
windows 10
STEPS TO REPRODUCE
To fully understand the issue it might be necessary to have access to an Application, which is installed via InstallAnywhere. Due to license shenanigans I am not sure if I am allowed to share our installation files.
To understand what goes wrong it might be necessary to run directly on a system and with ansible.
to run directly:
It is possible to spot the setup as children processes of powershell if the software is installed this way.
In that case you can find the processes without a parent process.
The
installer.properties
look like this:EXPECTED RESULTS
After a successful installation I except a working software, with working installation and a install log file.
ACTUAL RESULTS
The Software seems to be installed, but the uninstaller is not working also the install log is missing. While the system is still activated I am able to spot processes of the installer, which are not finished and they never exit. I can kill the process or restart the system to get rid of the process, but installation did not finished successful in those cases.
I have also contacted the Developer of the installer but waiting for response, but my hope is not very high.