sensu-agent cannot downgrade version on Windows using Chocolatey
elfranne opened this issue · 0 comments
elfranne commented
Description of problem
Forcing a specific version does not work with the Chocolatey Windows package manager.
The sensu 6.4 update requires specific way of signing certificates (requires dns alt names), so I wanted to downgrade the sensu version until i could fix the certificates.
Command used and debugging output
in hiera using:
sensu::version: '6.3'
The error from running Puppet:
Error: Could not update: Execution of 'C:\ProgramData\chocolatey\choco.exe upgra
de sensu-agent --version 6.3 -y --ignore-package-exit-codes --no-progress' retu
rned 1: Chocolatey v0.10.15
Upgrading the following packages:
sensu-agent
By upgrading you accept licenses for the packages.
A newer version of sensu-agent (v6.4.0.4826) is already installed.
Use --allow-downgrade or --force to attempt to upgrade to older versions, or us
e side by side to allow multiple versions.
Chocolatey upgraded 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- sensu-agent - A newer version of sensu-agent (v6.4.0.4826) is already install
ed.
Use --allow-downgrade or --force to attempt to upgrade to older versions, or us
e side by side to allow multiple versions.
Error: /Stage[main]/Sensu::Agent/Package[sensu-go-agent]/ensure: change from '6.
4.0.4826' to '6.3' failed: Could not update: Execution of 'C:\ProgramData\chocol
atey\choco.exe upgrade sensu-agent --version 6.3 -y --ignore-package-exit-codes
--no-progress' returned 1: Chocolatey v0.10.15
Upgrading the following packages:
sensu-agent
By upgrading you accept licenses for the packages.
A newer version of sensu-agent (v6.4.0.4826) is already installed.
Use --allow-downgrade or --force to attempt to upgrade to older versions, or us
e side by side to allow multiple versions.
Chocolatey upgraded 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- sensu-agent - A newer version of sensu-agent (v6.4.0.4826) is already install
ed.
Use --allow-downgrade or --force to attempt to upgrade to older versions, or us
e side by side to allow multiple versions.
Platform and version information
- Your OS: Windows 2012 server (but applies to all Windows likely)
- Your Ruby version: 2.5.9
- Your version of Puppet: 6.22.1
- Your version of Sensu:
- Your version of this module: 5.8.0 (latest)
Anything else to add that you think will be helpful?
An option to not manage the sensu-agent package or set the --allow-downgrade
as default option to be consistent with other OS.
package { 'sensu-go-agent':
ensure => $version,
provider => 'chocolatey',
install_options => ['--allow-downgrade'],
}