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

Boolean 'false' custom variables do not appear in configuration #400

Closed
ekeih opened this issue Nov 14, 2017 · 0 comments
Closed

Boolean 'false' custom variables do not appear in configuration #400

ekeih opened this issue Nov 14, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@ekeih
Copy link

ekeih commented Nov 14, 2017

We use boolean custom variables in our configuration. They work fine if they are true but they never end up in the configuration file if set to false.

Expected Behavior

false variables should be appear in the generated configuration.

Current Behavior

false variables are ignored. Only true values and non-booleans are used.

Possible Solution

I think the changes in 1ab1c6f are responsible for the bug. The if value conditions evaluate to false so the custom variables are ignored.

Steps to Reproduce (for bugs)

  1. Configure a check with boolean custom variables
  icinga2::object::service { 'icinga2':
    ensure               => present,
    import               => [ 'generic-service', ],
    target               => '/etc/icinga2/zones.d/globals.d/services.conf',
    display_name         => 'Icinga2 Status',
    check_interval       => '1m',
    retry_interval       => '30s',
    check_command        => 'icinga',
    zone                 => 'master',
    command_endpoint     => 'host.name',
    apply                => true,
    assign               => [ 'host.vars.check.icinga2.enable == true' ],
    enable_active_checks => false,
    vars                 => {
      enable_active_checks => false,
      bla                  => false,
      foobar               => true,
    }
  }
  1. Apply the puppet configuration
  2. Check the generated configuration: only the true variables are included.
apply Service "icinga2" to Host {
  import "generic-service"

  display_name = "Icinga2 Status"
  check_command = "icinga"
  check_interval = 1m
  retry_interval = 30s
  enable_active_checks = false
  zone = "master"
  command_endpoint = host.name
  vars.foobar = true
  assign where host.vars.check.icinga2.enable == true
}

Your Environment

  • Module version (puppet module list): We are using a fork of the module but it contains the same utils.rb as the latest upstream version.
  • Puppet version (puppet -V): 4.10.1
  • Operating System and version: Ubuntu 16.04
@lbetz lbetz added bug and removed bug labels Nov 16, 2017
@lbetz lbetz self-assigned this Nov 16, 2017
@lbetz lbetz added the bug label Nov 18, 2017
@lbetz lbetz added this to the v1.3.4 milestone Nov 18, 2017
@lbetz lbetz closed this as completed in ed7affe Nov 19, 2017
lbetz added a commit that referenced this issue Nov 19, 2017
…-in-config-400

fix #400 boolean false custom variables do not appear in configuration
n00by pushed a commit to n00by/puppet-icinga2 that referenced this issue Apr 26, 2018
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

2 participants