Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
413 stars 203 forks source link

Override vars not applied like shown #2720

Open slalomsk8er opened 1 year ago

slalomsk8er commented 1 year ago

Expected Behavior

Override vars get applied like shown.

Current Behavior

image

all cmd parameters except --device-id and cmd defaults are gone. none of of the "Override vars" form the host template end up in the command line:

'/usr/lib64/nagios/plugins/huawei-dorado-backup-power' '--cache-expire' '15' '--device-id' '12341234234214' '--scope' '0' '--timeout' '3'

Steps to Reproduce (for bugs)

  1. apply service set to host template
  2. override vars in service set on host template
  3. override vars on service set on host unseing the template
  4. deploy and watch override vars form host template missing in inspect

Your Environment

NavidSassan commented 1 year ago

I will have a look if this is caused by our Linuxfabrik fork / command configuration.

NavidSassan commented 1 year ago

Reproducible both with v1.10.2 and master (b55df21c2109f0ee1ca8baf747b52ce05d944df7). I think the problem is that the override variables of the host template and the host itself do not get merged - the host overwrites the ones set on the host template (probably due to the way the arrays are merged). However, this is not what the GUI makes the user believe.

Expected Behavior

The GUI needs to be consistent with the generated config. When applying an overwrite on the host template and the host itself, both should be in effect - or the GUI needs to show the actual (current) effect.

Current Behavior

Only the variables set on the host itself are effectively used.

Possible Solution

Either adjust the GUI or the merging logic.

Steps to Reproduce (for bugs)

  1. Import the following basket: basket.json.txt
  2. Add a test host: icingacli director host create localhost --imports tpl-host --address localhost
  3. icingacli director config deploy
  4. Have a look at the inspect tab of the service. Notice that field1 has a value, which is used in the command. field1 is set on the host template. The same can be seen using icingacli director host show localhost --resolved.
  5. Now add an override to the host itself: icingacli director service set 'test service' --host localhost --vars.field2 'set on the host itself' --allow-overrides
  6. icingacli director config deploy
  7. Again, have a look at the inspect tab and icingacli director host show localhost --resolved. Note that only field2 is being used, even though the GUI shows both fields.

gui

Your Environment

moreamazingnick commented 1 year ago

2424