Git Product home page Git Product logo

puppet-module-sensuclassic's Issues

Ubuntu 14.04 LTS is EOL

Ubuntu 14.04 LTS is now end of life.

It should be removed from

  • metadata.json
  • docs
  • vagrant
  • testing

undefined method `pretty_generate' for Puppet::Pops::Loader::RubyFunctionInstantiator::JSON:Module

Description of problem

During a puppet run, I get the following error:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method `pretty_generate' for Puppet::Pops::Loader::RubyFunctionInstantiator::JSON:Module (file: /etc/puppetlabs/code/environments/production/modules/vault/manifests/config.pp, line: 30, column: 16) on node vault

  • What did you expect to happen?

to compile into a catalog

  • How can someone reproduce the problem?

It should be enough to do a include vault + having the sensuclassic module in the environment.

Command used and debugging output

  • What does your puppet config look like (including any hiera config)

There is no sensu related config on the affected machine

  • Is this a masterless or master based puppet setup?

master

Platform and version information

  • Your OS: Arch Linux
  • Your Ruby version: 2.6.4
  • Your version of Puppet: 5.5.17
  • Your version of Sensu: there is no sensu installed
  • Your version of this module: v3.4.0

Anything else to add that you think will be helpful?

The vault module uses to_json_pretty from stdlib:
https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/functions/to_json_pretty.rb#L75

It basically calls JSON.pretty_generate(). That method is provided by the default json module from the ruby core lib. My guess is that the module JSON overwrites the class from the core lib.

The methods validate_keys(), sorted_generate() and sorted_pretty_generate() should probably extend the json class or stay within the scope of this module?

Windows sensu service DSC error for starting

Description of problem

  • What did you do? Stopped the Windows sensu-client service and ran puppet
  • What happened? The puppet run threw a DSC error about creation of the service as it already existed and skipped starting the service
  • What did you expect to happen? Puppet to start the Windows sensu-client service which does happen on Linux clients correctly
  • How can someone reproduce the problem? Stop the Windows sensu-client service and run puppet

Command used and debugging output

  • What does your puppet config look like (including any hiera config)
  • Is this a masterless or master based puppet setup? Master based

Platform and version information

Your OS: Redhat 7.8 (Maipo)
Your Ruby version: ruby 2.0.0.648-36.el7.x86_64
Your version of Puppet: 5.5.20 open source
Your version of Sensu: 1.8.0.1 (Windows client)
Your version of this module: 3.4.1
DSC module version: 1.9.3

Anything else to add that you think will be helpful?

I have attached the Puppet run below but the main part of the error is:

Error: Could not set 'present' on ensure: PowerShell DSC resource MSFT_ServiceResource failed to execute Set-TargetResource functionality with error message: The service 'sensu-client' to create alre ady exists with path 'c:\opt\sensu\bin\sensu-client.exe' (file: /etc/puppetlabs/code/environments/test/modules/external/sensuclassic/manifests/client.pp, line: 75) Error: Could not set 'present' on ensure: PowerShell DSC resource MSFT_ServiceResource failed to execute Set-TargetResource functionality with error message: The service 'sensu-client' to create alre ady exists with path 'c:\opt\sensu\bin\sensu-client.exe' (file: /etc/puppetlabs/code/environments/test/modules/external/sensuclassic/manifests/client.pp, line: 75) Wrapped exception: PowerShell DSC resource MSFT_ServiceResource failed to execute Set-TargetResource functionality with error message: The service 'sensu-client' to create already exists with path 'c:\opt\sensu\bin\sen su-client.exe'

Puppet_Run_Service_Start_Issue.txt

Service started before config applied

Description of problem

  • What did you do? Within a base image we have the sensu-client installed with config but without a windows service created
  • What happened? When puppet runs on a host built off of that base image the sensuclassic module uses the DSC resource to create the service and start it during the the puppet run before the config gets put down within that same puppet run.
  • What did you expect to happen? Config changes to happen before any service creations and starts
  • How can someone reproduce the problem? They can install Sensu, remove the service then run puppet

Command used and debugging output

  • What does your puppet config look like (including any hiera config)
  • Is this a masterless or master based puppet setup? Master based setup

Platform and version information

  • Your OS: Redhat 7.8 (Maipo)
  • Your Ruby version: ruby 2.0.0.648-36.el7.x86_64
  • Your version of Puppet: 5.5.20 open source
  • Your version of Sensu: 1.8.0.1 (Windows client)
  • Your version of this module: 3.4.1

Anything else to add that you think will be helpful?

deprecated `validate_bool()` function

Description of problem

I noticed warnings like this in the puppetserver logs:

2020-06-01T16:13:11.870Z WARN  [qtp605080165-47] [puppetserver] Puppet This method is deprecated, please use the stdlib validate_legacy
 function,
                    with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README. at ["/etc/pup
petlabs/code/environments/production/modules/sensuclassic/manifests/init.pp", 631]:["/etc/puppetlabs/code/environments/production/site-
modules/role/manifests/common.pp", 8]
...

sensuclassic_sorted_json

Description of problem

  • What did you do?

I use this module on a Puppetserver 6.5.0 environment

  • What happened?

During an agent run, I get the following error message:

...
Info: Retrieving locales
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.SecurityError: (SecurityError) Illegal method definition of method 'validate_keys' on line 8' in legacy function. See https://puppet.com/docs/puppet/latest/functions_refactor_legacy.html for more information
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
  • What did you expect to happen?

I expected a function that doesn't use the legacy 3.x Puppet API.

  • How can someone reproduce the problem?

I will try to post a minimale example later. Everything that uses the sensuclassic_sorted_json() method will produce this error.

Command used and debugging output

  • What does your puppet config look like (including any hiera config)
  • Is this a masterless or master based puppet setup?

Platform and version information

  • Your OS: CentOS 6 for the Puppet agent, CentOS 7 for the Puppetserver.
  • Your Ruby version: AIO versions. ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux] on the agent, jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.222-b10 on 1.8.0_222-b10 +jit [linux-x86_64 on the server
  • Your version of Puppet: puppet-agent-5.5.16-1.el6.x86_64 and puppetserver-6.5.0-1.el7.noarch
  • Your version of Sensu: sensu-1.8.0-1.el6.x86_64
  • Your version of this module: master branch

Anything else to add that you think will be helpful?

The metadata.json mentions that this module supports Puppet 6. The tests work, but the code clearly matches the described one in the error article at https://puppet.com/docs/puppet/latest/functions_refactor_legacy.html. I don't yet understand why the tests work.

Feature request: Add ability to have configuration changes reload sensu-enterprise instead issuing a restart

Description of feature request

In Sensu Enterprise 2.6.0, a reload option was added to interactive with the service sensu-enterprise:

https://docs.sensu.io/sensu-enterprise/3.6/changelog/#enterprise-v2-6-0

IMPROVEMENT: Sensu Enterprise now loads configuration and validates it prior to reloading (SIGHUP). If configuration is determined to be invalid prior to reloading, Sensu will report invalid configuration definitions, and it will continue to run with its existing working configuration.

Currently, when a configuration change is detected in /etc/sensu/conf.d/ and Sensu Enterprise is being used, Puppet will attempt a restart on the senssu-enterprise service. If invalid JSON some how ends up inside /etc/sensu/conf.d/, this will cause the service to be stopped and then started again, putting sensu-enterprise into a non-running state.

This request is to have an option added for Puppet to execute a reload against sensu-enterprise instead of a restart on configuration changes, which allows for the above linked and quoted feature of the sensu-enterperirse service to be taken advantage of.

In looking at the code, a notify is being done to the service for configuration changes in /etc/sensu/conf.d, which based on Puppet documentation, results in a restart of the service.

https://github.com/sensu/sensu-puppet/blob/v2.63.0/manifests/check.pp#L271
https://github.com/sensu/sensu-puppet/blob/v2.63.0/manifests/write_json.pp#L60
https://puppet.com/docs/puppet/5.3/metaparameter.html#notify

Windows client value set to false throws puppet run error

Description of problem

  • What did you do? We installed Sensu-Client successfully using puppet and then we set the client var to false to disable the service.
  • What happened? Puppet threw and error about Exec[install-sensu-client-service].
  • What did you expect to happen? The service to be stopped and disabled.
  • How can someone reproduce the problem? Install Sensu-Client using puppet then set the value for client to false i.e. sensu::client: false or sensuclassic::client: false to set the service into a stopped and disabled state.

Command used and debugging output

  • What does your puppet config look like (including any hiera config) - I have attached example class we are using to install the Sensu-Client which also shows hiera to set the client value.

I have tested a possible fix which runs puppet successfully see diff attached as it doesn't display correctly for client.pp:

  • Is this a masterless or master based puppet setup? Master based

Platform and version information

  • Your OS: Redhat 7.8 (Maipo)
  • Your Ruby version: ruby 2.0.0.648-36.el7.x86_64
  • Your version of Puppet: 5.5.20 open source
  • Your version of Sensu: 1.8.0.1 (Windows client)
  • Your version of this module: 3.6.2

Anything else to add that you think will be helpful?

DSC module version: 1.9.3

Error that is seen when running puppet:

Info: Using configured environment test Info: Retrieving pluginfacts Info: Retrieving plugin Info: Retrieving locales Info: Loading facts Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Exec[install-sensu-client-service]' in parameter 'before' (file: /modules/external/sensuclassic/manifests/client.pp, line: 55) on node test.domain.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.