Skip to content
This repository has been archived by the owner on Apr 16, 2018. It is now read-only.

[dev.icinga.com #11365] apply_scheduleddowntimes can not handle vars as ranges #348

Open
icinga-migration opened this issue Mar 12, 2016 · 0 comments
Labels

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11365

Created by dagobert on 2016-03-12 17:04:23 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-03-12 17:04:23 +00:00 (in Redmine)


Trying to implement more sophisticated downtimes I ran into the problem of not being able to use vars from services or hosts in the object.

The following is not working because '$abc$' does not seem to be "translated" in scheduleddowntime as in apply_services for example.

icinga2::object::apply_scheduleddowntime { 'backup-downtime':
    author => 'Backup-Administrator',
    comment => 'Scheduled downtime for backup',
    ranges  => {
      monday    => '$service.vars.backup_downtime$',
      tuesday   => '$service.vars.backup_downtime$',
      wednesday => '$service.vars.backup_downtime$',
      thursday  => '$service.vars.backup_downtime$',
      friday    => '$service.vars.backup_downtime$',
      saturday  => '$service.vars.backup_downtime$',
      sunday    => '$service.vars.backup_downtime$',
    },
    assign_where => 'service.vars.backup_downtime != ""',
  }

The following is not working because puppet-icinga2 is quoting the vars.

...
    ranges  => {
      monday    => 'service.vars.backup_downtime',
...

to

...
  ranges = {
    "monday" = "service.vars.backup_downtime"
...

Icinga is only accepting the following as valid.

...
  ranges = {
    "monday" = service.vars.backup_downtime
...

Note: This is the same or similar problem as in this issue (https://dev.icinga.org/issues/10804)

I propose to create a separate object for this type of apply, which is not quoting the ranges.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant