mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
IcingaConfig: allow to override vars for dynamic...
...host-crafted services
This commit is contained in:
parent
c5811fe055
commit
93e4cc9b5b
@ -414,25 +414,35 @@ class IcingaConfig
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$varname = $this->getMagicApplyVarName();
|
||||||
|
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'
|
'
|
||||||
apply Service for (title => params in host.vars["%s"]) {
|
apply Service for (title => params in host.vars["%s"]) {
|
||||||
if (typeof(params["imports"]) in [Array, String]) {
|
|
||||||
import params["imports"]
|
override = host.vars["%s_vars"][title]
|
||||||
|
|
||||||
|
if (typeof(params["templates"]) in [Array, String]) {
|
||||||
|
import params["templates"]
|
||||||
} else {
|
} else {
|
||||||
import title
|
import title
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof(params["vars"]) == Dictionary) {
|
if (typeof(params.vars) == Dictionary) {
|
||||||
vars += params
|
vars += params
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof(override.vars) == Dictionary) {
|
||||||
|
vars += override.vars
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof(params["host_name"]) == String) {
|
if (typeof(params["host_name"]) == String) {
|
||||||
host_name = params["host_name"]
|
host_name = params["host_name"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
',
|
',
|
||||||
$this->getMagicApplyVarName()
|
$varname,
|
||||||
|
$varname
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user