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

Class ::icingaweb2::module::monitoring doesn't work with Documentation defaults #253

Closed
grant-veepshosting opened this issue Dec 4, 2019 · 3 comments
Labels
Milestone

Comments

@grant-veepshosting
Copy link

  1. Use the documentation default configs on Ubuntu 18.04, eg:
class profile::icingaweb2 {
  contain ::icingaweb2
  contain ::icingaweb2::module::monitoring
  class { 'icingaweb2::module::monitoring':
    ido_host        => '127.0.0.1',
    ido_db_name     => 'db',
    ido_db_username => 'user',
    ido_db_password => 'thepassword',
    commandtransports => {
      icinga2 => {
        transport => 'api',
        username  => 'root',
        password  => 'icinga',
      }
    }
  }
}

-->

Expected Behavior

It should configure the monitoring source and command transport correctly.

Current Behavior

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Class[Icingaweb2::Module::Monitoring]: parameter 'commandtransports' expects a Hash value, got Undef (file: /etc/puppetlabs/code/environments/production/site/profile/manifests/icingaweb2.pp, line: 14, column: 3) on node

@grant-veepshosting
Copy link
Author

UPDATE - we have found the cause and fixed this.

OLD VALUE, BROKEN:

class icingaweb2::module::monitoring(
  (other parameters that work fine)
  Hash                           $commandtransports    = undef,
){...

NEW VALUE, WORKS:

class icingaweb2::module::monitoring(
  (other parameters that work fine)
  Hash                           $commandtransports    = {},
){...

@dnsmichi
Copy link
Contributor

dnsmichi commented Dec 4, 2019

Hmmm which Puppet version are you using? I've seen a similar behaviour with the MongoDB module where it suddenly expected a value from me.

@grant-veepshosting
Copy link
Author

Puppet v6 latest. The fix documented above has resolved the issue. The default parameter for the hash needs to be {} instead of undef.

@lbetz lbetz added the bug label Apr 27, 2020
@lbetz lbetz added this to the v2.4.0 milestone Apr 27, 2020
@lbetz lbetz closed this as completed in 0f131c8 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants