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

[dev.icinga.com #12959] Attribute function does not included adding value #139

Closed
icinga-migration opened this issue Oct 21, 2016 · 5 comments
Milestone

Comments

@icinga-migration
Copy link

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

Created by lbetz on 2016-10-21 21:24:37 +00:00

Assignee: lbetz
Status: Closed (closed on 2016-11-18 14:54:42 +00:00)
Target Version: v0.6.0
Last Update: 2016-11-18 14:54:42 +00:00 (in Redmine)


At the moment it's not possible to add values to an attribute that already exists.

template Host "xyz" {
...
groups = [ .... ]
}

object Host "zzz" {
import "xyz"

groups += [ ... ]
}

Any nomination to solve this problem?

@icinga-migration
Copy link
Author

Updated by lbetz on 2016-10-21 21:25:51 +00:00

  • Target Version set to v0.6.0

@icinga-migration
Copy link
Author

Updated by bsheqa on 2016-11-10 16:07:29 +00:00

My proposal:

Detect if the first element is a +

icinga2::object::hostgroup { 'monitoring-hosts':
  display_name => 'Linux Servers',
  groups       => ['+', 'linux-servers' ],
  target       => '/etc/icinga2/conf.d/groups2.conf',
}

This is not elegant at all and probably nobody understand it.

I would suggest to not support this at all. There is no case I can think of one would use this in combination with puppet.

@icinga-migration
Copy link
Author

Updated by lbetz on 2016-11-15 15:08:53 +00:00

  • Assigned to set to lbetz

Trying to implement parsing of

groups => 'groups + [ newgroup, anothernewgroup ]'

@icinga-migration
Copy link
Author

Updated by lbetz on 2016-11-15 16:59:25 +00:00

current version return

object foo "bar" {
vars = vars + "config"
}

=> variables from apply for have to be added to constants during runtime.

@icinga-migration
Copy link
Author

Updated by lbetz on 2016-11-18 14:54:42 +00:00

  • Status changed from Feedback to Closed
  • Done % changed from 0 to 100

now we pick up variables out of an apply for (foo => bar in ....) of (foo in ...)

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

No branches or pull requests

1 participant