-
Notifications
You must be signed in to change notification settings - Fork 0
Variable inheritance
This plugin makes some assumptions and decisions which are explained here. It tries to keep closely what you might expect by Ansible and so should hopefully makes things easy to understand. The main principle is that a local file should have more power then a group variable defined in an Open-AudIT location but the variable defined in a device should be one to rule them all..
-
Open-AudIT -> Location -> field"Suite" (suiteinternally) - Variables from the
compose* definition. Taken from the config file specified by-i <hosts.openaudit.yml> -
Open-AudIT -> Fields -> <your custom field>(must be set in a device's config)
If you specify
-
myvar="set_in_location"in an Open-AudIT location (see above)
Then myvar will have the value: set_in_location. You keep that variable in the Open-AudIT location and now specify the same variable but here, too:
- in the
compose* definition of a local config file (something.openaudit.yml)
compose:
myvar: set_in_compose
Then myvar will have the value: set_in_compose.
You keep that variable in the Open-AudIT location and in the compose section and now specify the same variable but here, too:
- in Open-AudIT -> add a custom field named
myvar. You open the device in Open-AudIT and set the value of that custom field (open custom fields from the left menu) toset_in_device.
Then myvar will have the value: set_in_device (for all devices having that variable set)
Again: You still have the above location/suite var and the local config file with the same variable name but the device wins. Like host variables in Ansible itself.
[*] note: compose is not capable of matching variables based on conditions. That means every(!) hosts will get the variable as long as it is itself valid. Just keep this in mind.