-
Notifications
You must be signed in to change notification settings - Fork 32
Not Working-Removing a package from chocolatey without attempting to uninstall the program #176
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
Comments
As the |
Hello...this really has nothing to do with the splunkforwarder package itself. Was using this as just an example. When using this module against any package that you just need to "remove" but not uninstall does not work. I reviewed the win_chocolatey.ps1 script in the module and from what I can see, the "choco_args" are not being passed when choosing "absent" for a state in the task.
From the Chocolatey Docs for Uninstall, it would be passing the command as documented here directly to the choco.exe command, not as a package parameter: -n --skipautouninstaller NOTE: Re-noting that running "choco uninstall splunkforwarder -n --skipautouninstaller" from the server itself DOES Remove from I am hoping this is the issue, but if I am mistaken, please let me know. |
That skips the Chocolatey Automatic Uninstaller from running. The software is still removed if Chocolatey can do so in other ways.
The "absent" state is to ensure the package, which includes the software, is absent. The Chocolatey Ansible module manages packages, so this is expected behaviour. |
Thank you for the information. I understand what you are saying. I just feel that the module should have this capability, (remove package from Chocolatey and do not uninstall) but if it doesn't then it is what it is. |
Checklist
What You Are Seeing?
When using the "chocolatey.win_chocolatey" module with the following parameters to remove the package from chocolatey without attempting to uninstall the program is not working:
- name: Remove/Not Uninstall Chocolatey Package
chocolatey.chocolatey.win_chocolatey:
name: splunkforwarder
state: absent
choco_args: --skipautouninstaller
Have tried this also:
- name: Remove/Not Uninstall Chocolatey Package
chocolatey.chocolatey.win_chocolatey:
name: splunkforwarder
state: absent
choco_args:
--skipautouninstaller
What is Expected?
Running this task will Remove Package from Chocolatey but NOT uninstall the program:
- name: Remove/Not Uninstall Chocolatey Package
chocolatey.chocolatey.win_chocolatey:
name: splunkforwarder
state: absent
choco_args:
--skipautouninstaller
How Did You Get This To Happen?
Chocolatey but NOT uninstall the program
chocolatey.chocolatey.win_chocolatey:
name: splunkforwarder
state: absent
choco_args: --skipautouninstaller
chocolatey.chocolatey.win_chocolatey:
name: package1
state: absent
choco_args:
--skipautouninstaller
{
"changed": true,
"invocation": {
"module_args": {
"checksum_type": null,
"override_args": false,
"allow_prerelease": false,
"source_username": null,
"allow_multiple": false,
"timeout": 2700,
"remove_dependencies": false,
"proxy_url": null,
"source_password": null,
"proxy_password": null,
"checksum64": null,
"install_args": null,
"name": [
"splunkforwarder"
],
"checksum": null,
"version": null,
"skip_scripts": false,
"bootstrap_tls_version": [
"tls12",
"tls13"
],
"force": false,
"choco_args": [
"--skipautouninstaller"
],
"architecture": "default",
"proxy_username": null,
"pinned": null,
"validate_certs": true,
"ignore_checksums": false,
"allow_empty_checksums": false,
"bootstrap_script": null,
"checksum_type64": null,
"state": "absent",
"ignore_dependencies": false,
"source": null,
"package_params": null
}
},
"rc": 0,
"choco_cli_version": "1.4.0",
"stdout": "Chocolatey v1.4.0 Business\r\nUninstalling the following packages:\r\nsplunkforwarder\r\n\r\nsplunkforwarder v9.3.2.0\r\n Running auto uninstaller...\r\n Auto uninstaller has successfully uninstalled splunkforwarder or detected previous uninstall.\r\n splunkforwarder has been successfully uninstalled.\r\n\r\nChocolatey uninstalled 1/1 packages. \r\n See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).\r\n",
"stdout_lines": [
"Chocolatey v1.4.0 Business",
"Uninstalling the following packages:",
"splunkforwarder",
"",
"splunkforwarder v9.3.2.0",
" Running auto uninstaller...",
" Auto uninstaller has successfully uninstalled splunkforwarder or detected previous uninstall.",
" splunkforwarder has been successfully uninstalled.",
"",
"Chocolatey uninstalled 1/1 packages. ",
" See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log)."
],
"_ansible_no_log": false
}
System Details
Installed Packages
Output Log
Sensitive data in log
Additional Context
No response
The text was updated successfully, but these errors were encountered: