-
Notifications
You must be signed in to change notification settings - Fork 35
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
Different var syntax #310
Comments
Hi, could you explain what exactly you try to achieve? I'm not sure whether the Also, how does Please try to use code blocks and proper indentation next time to make everything more readable for people who'd like to help :) Small example achieving vars:
icinga2_objects:
- name: host1
type: Host
file: "local.d/testing.conf"
address: "localhost"
check_command: "hostalive4"
vars:
disks:
- "disk1"
- "disk2"
- "disk3"
- name: Disk
type: Service
file: "local.d/testing.conf"
apply: true
apply_for: hdisk => config in host.vars.disks
check_command: disk
vars: + config
assign:
- host.vars.disks The above results in the following
As you can probably tell, you can't have both Example achieving vars:
icinga2_objects:
- name: host1
type: Host
file: "local.d/testing.conf"
address: "localhost"
check_command: "hostalive4"
vars:
disks:
- "disk1"
- "disk2"
- "disk3"
- name: Disk
type: Service
file: "local.d/testing.conf"
apply: true
apply_for: config in host.vars.disks
check_command: disk
vars:
foo: "bar"
disk_partitions: config
disk_wfree: "10%"
assign:
- host.vars.disks ->
|
Hi. What I want to achieve is that we use the configuration from host. and overwrite 2 values by default:
With Icinga it is working. But there is no way with the collection I think |
Hm, this sounds tricky or even 'impossible'. my_dict:
varname: "first value"
varname: "second value" my_dict.varname = "second value" To implement vars: + config
vars:
some_key: "some value" This is not possible AFAIK. |
You could define your defaults in a template an import it to your assign rule. Then the Icinga mechanics will solve the problem for you. Just use
|
Hi,
I want to create an object file like this:
I think its not possible, or does anybody knows a way?
Edit: Better readability
The text was updated successfully, but these errors were encountered: