Skip to content

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

@jmcnatt

Description

@jmcnatt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions