Skip to content

Fix #391: Allow package_ensure => latest on Windows with Chocolatey provider#420

Merged
kenyon merged 4 commits intovoxpupuli:masterfrom
raman1236:master
Feb 18, 2026
Merged

Fix #391: Allow package_ensure => latest on Windows with Chocolatey provider#420
kenyon merged 4 commits intovoxpupuli:masterfrom
raman1236:master

Conversation

@raman1236
Copy link
Copy Markdown
Contributor

@raman1236 raman1236 commented Feb 17, 2026

Pull Request (PR) description

This PR fixes issue #391 by allowing package_ensure => 'latest' on Windows when using Chocolatey as the package provider.

Changes Made

  • Modified validation logic in manifests/forwarder.pp and manifests/enterprise.pp
  • The validation now only fails when OS is Windows AND package_ensure is 'latest' AND package_provider is NOT 'chocolatey'
  • Updated error message to guide users to use Chocolatey when they want to use ensure => latest on Windows

Rationale

As mentioned in #391, Chocolatey supports package upgrades, making it possible to use ensure => latest on Windows. The previous implementation blocked this functionality entirely based solely on the OS family, preventing legitimate use cases where Chocolatey is used as the package provider.

Example Usage

Users can now successfully use:

class { 'splunk::forwarder':
  package_ensure   => 'latest',
  package_provider => 'chocolatey',
}

Backward Compatibility

  • Changes maintain full backward compatibility
  • Still fails appropriately for non-Chocolatey providers on Windows (like MSI)
  • No impact on non-Windows systems

This Pull Request (PR) fixes the following issues

Fixes #391

@kenyon kenyon changed the title Fix #391: Allow package_ensure => latest on Windows with Chocolatey provider Fix #391: Allow package_ensure => latest on Windows with Chocolatey provider Feb 18, 2026
@kenyon kenyon merged commit 9034321 into voxpupuli:master Feb 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove or make optional failure statement for ensuring latest on Windows

3 participants