icingaweb2-module-director
icingaweb2-module-director copied to clipboard
Overriden service custom properties are incorrectly deployed
To Reproduce
- Create a host template
generic-host-template
. - Create a service template
generic-service-template
. - Create and add the following custom properties of data type string to
generic-service-template
.-
service_var_a
-
service_var_b
-
- Create a service
service-a
importing templategeneric-service-template
for hostgeneric-host-template
. - Set the values of custom properties as below.
-
service_var_a
:service-value-a
-
service_var_b
:service-value-b
-
- Create a host template
child-host-template
importinggeneric-host-template
. - Override the value of
service_var_a
of the inherited serviceservice-a
ofchild-host-template
tohost-template-value-a
. - Create a host
host-a
importingchild-host-template
. - Override the value of
service_var_b
of the inherited serviceservice-a
ofhost-a
tohost-value-b
. - Deploy your changes.
- The values of custom properties of the deployed service
service-a
forhost-a
will be as following:service_var_a
:service-value-a
service_var_b
:host-value-b
The value of service_var_a
which was overridden in the inherited service service-a
of host template child-host-template
is lost.
This has been depicted in the diagrams below.
Director Configuration
classDiagram
generic-host-template --|> child-host-template
child-host-template --|> host-a
generic-service-template --|> service-a
generic-service-template: custom_vars = [service_var_a, servie_var_b]
generic-host-template: services = [service-a]
class child-host-template{
imports generic-host-template
inherited services = [service-a]
vars._override_servicevars = [service-a => [service_var_a = 'host-template-value-a']]
}
class host-a{
imports child-host-template
inherited services = [service-a]
vars._override_servicevars = [service-a => [service_var_b = 'host-value-b']]
}
class service-a{
imports generic-service-template
host = generic-host-template
vars.service_var_a = 'service-value-a'
vars.service_var_b = 'service-value-b'
}
Actual deployed service for host-a
classDiagram
service-a
service-a: host = host-a
service-a: vars.service_var_a = 'service-value-a'
service-a: vars.service_var_b = 'host-value-b'
Expected deployed service for host-a
classDiagram
service-a
service-a: host = host-a
service-a: vars.service_var_a = 'host-template-value-a'
service-a: vars.service_var_b = 'host-value-b'
refer: ref/IP/51840
#2424