-
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
Apply rule disk is missing the assign rule. #307
Comments
By the way. Docu (https://github.com/Icinga/ansible-collection-icinga/blob/main/doc/role-icinga2/objects.md) [...]
|
TLDR: Apply for could be discussed though. Here we'd have an implicit assign rule due to If you really don't want any assign rule, just give it a Any other opinion on that matter, @mkayontour? First point: If you use Example using a dictionary:
Thanks about the hint to the docs. Looks wrong to me. I'll change that. Now to your actual question: Technically, from Icinga 2's point of view, an assign rule is not necessary.
Looking at the problem from Ansible's point of view I think it would be smarter to use hostvars to determine for example what disks a host has. Afterwards one can create Services based on that information instead of letting Icinga 2 check conditions (again) by using apply rules. With the collection you can also simply do something like |
Hi. I tried to configure this.
apply Service for (disk => config in host.vars.disks) {
import "generic-service"
check_command = "disk"
vars += config
}
The collection throws an error "FAILED! => {"msg": "Apply rule disk is missing the assign rule."}" with the following object definition:
icinga2_objects:
hostname.de:
- name: disk
type: Service
imports:
- generic-service
apply: true
apply_for: disk => config in host.vars.disks
file: 'zones.d/global-templates/disk-service-apply.conf'
check_command: "disk"
vars: + config
It seems to be bug, because assign shouldnt be necessary?
Thank you guys.
The text was updated successfully, but these errors were encountered: