Default Values
When dealing with large configurations, it is important to have a way to set default values for certain keys, to avoid repeating the same values in multiple files and while making it easier to manage the configuration.
Each data model comes with certain default values based on common best practices. In some cases these default values might not be appropriate for a specific environment, therefore those values can be overridden in the configuration files.
For example, if we want to change the default value of the unicast_routing
attribute of an ACI bridge domain, we can do so by overriding the default value in the configuration file. The default value is set to true
, but we want to set it to false
for our specific environment.
defaults: apic: tenants: bridge_domains: unicast_routing: false
The default values follow the same structure and hirarchy as the data model, where everything is defined under a defaults
root element. Lists in the data model (e.g., tenants
) are defined as dictionaries in the defaults section. The default values are merged with the configuration data, where the configuration data takes precedence over the default values. This means that if a key is present in both the defaults and the configuration data, the value from the configuration data will be used.