Skip to content
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

Remove or make optional failure statement for ensuring latest on Windows #391

Open
jmcnatt opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@jmcnatt
Copy link

jmcnatt commented Dec 19, 2024

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: All versions
  • Ruby: All versions
  • Distribution: Windows
  • Module version: 10.0.0

How to reproduce (e.g Puppet code you use)

In a class, the following code can be applied on a Windows node:

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

It is possible to ensure latest with Chocolatey as the package provider. This code block in forwarder.pp makes it impossible to ensure => latest on a Windows-based node.

if ($facts['os']['family'] == 'windows') and ($package_ensure == 'latest') {
    fail('This module does not currently support continuously upgrading the Splunk Universal Forwarder on Windows. Please do not set "package_ensure" to "latest" on Windows.')
  }

What are you seeing

The following error is produced:

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, This module does not currently support continuously upgrading the Splunk Universal Forwarder on Windows. Please do not set "package_ensure" to "latest" on Windows. (file: /etc/puppetlabs/code/environments/production/modules/splunk/manifests/forwarder.pp, line: 208, column: 5) on node <REDACTED>

What behaviour did you expect instead

  • Successful catalog compilation and run.

Output log

Any additional information you'd like to impart

Calculating this potential incompatibility could be achieved with basing the condition on the provider, rather than the OS family.

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

No branches or pull requests

1 participant