-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chocolately installs and then fails to find choco.exe but RC is 0 #170
Comments
|
I was following the advice of #40 which was closed with the solution I am trying. I'll use the powershell script instead. |
I don't see that documented (I could be missing it). Apologies @un@UNiXMIT. @vexx32 you left this comment which indicates this should work? |
I changed it to run the powershell script at instance creation and that works OK anyway. |
I can see one of the first things this does is call the I wonder if this is the PATH being set but not being pulled into subsequent tasks. I'll leave this for @vexx32 or @Windos to look at. Again, apologies @UNiXMIT I was too quick off the bat to respond. This looks to be related to #118 |
@UNiXMIT hi! what is the client machine running? and just to make sure, what version of the collection are you currently using? The only way this could happen that I can see right now is:
Because... even if it's not on PATH, as long as it's in the usual location, we will find it -- see here: chocolatey-ansible/chocolatey/plugins/module_utils/Common.psm1 Lines 40 to 76 in 981a967
This is called from here, after running the installation script for choco: chocolatey-ansible/chocolatey/plugins/module_utils/Packages.psm1 Lines 1189 to 1214 in 981a967
|
Okay, did a little more digging as well... I think the conclusion in the other issue is that the .NET 4.8 install was attempted and possibly failed. That failure case could potentially result in our installation process not registering an error exit code due to how PowerShell handles a ... There might be an argument to be made that the .NET 4.8 installation failing during the choco install should just ensure that an error exit code be set, rather than just throwing, and we should be careful to make sure the error is rethrown all the way to the top. That would be an issue to resolve in the chocolateyInstaller.psm1 that's part of choco's installation process itself. I.e., it should make careful use of In the meantime the best solution is likely to follow this pattern and ensure .NET 4.8 is installed and a reboot is performed before installing Chocolatey. We can handle that better in future, I think, but that's gonna take some additional careful scripting in the choco installer itself. |
Checklist
What You Are Seeing?
When the following task is run
I get this error even though the return code is 0
Does the installer not set choco.exe on the PATH?
What is Expected?
I expect the install of choco via the ansible task to work and not to fail my whole play.
How Did You Get This To Happen?
Task to use:
System Details
RHEL 9.4
Installed Packages
Output Log
Additional Context
No response
The text was updated successfully, but these errors were encountered: