Role configuration for eos_cli_config_gen¶
Role configuration settings can be set either as regular inventory variables or directly as task_vars on the import_role
task.
Role default output directories¶
Default output directories can be updated by modifying the default role variables:
# Roles Defaults - ouptput directories
# Root directory where to build output structure
root_dir: '{{ inventory_dir }}'
# Documentation folders
# Main documentation folder
documentation_dir_name: 'documentation'
documentation_dir: '{{ root_dir }}/{{ documentation_dir_name }}'
# Device documentation
devices_dir_name: 'devices'
devices_dir: '{{ documentation_dir }}/{{ devices_dir_name }}'
# AVD configurations output
# Main output directory
output_dir_name: 'intended'
output_dir: '{{ root_dir }}/{{ output_dir_name }}'
# Output for structured YAML files:
structured_dir_name: 'structured_configs'
structured_dir: '{{ output_dir }}/{{ structured_dir_name }}'
# EOS Configuration Directory name
eos_config_dir_name: 'configs'
eos_config_dir: '{{ output_dir }}/{{ eos_config_dir_name }}'
Tip
You might need the outputs generated by AVD in a different folder than inventory (the default). If updating root_dir
, leverage a relative path from inventory_dir
to ensure consistent behavior. Example: root_dir: '{{ inventory_dir}}/../outputs'
.
Input Variables Validation settings¶
Schema validation is built in to the central Action plugins used in AVD. Each plugin runs variable type conversion first and then performs validation of the converted data.
By default any data validation issues will trigger errors - blocking further processing. This behavior can be adjusted by setting the variable described below.
Danger
The input variable avd_data_validation_mode
now has a default value of error
, and while it can be set to warning
, this is highly discouraged.
All AVD code relies on the validation to ensure valid data, so the code assumes that the data is valid.
If the validation mode is set to warning
, execution will continue with invalid data, which can lead to hard-to-read errors or incorrect behavior.
Variable | Type | Required | Default | Value Restrictions | Description |
---|---|---|---|---|---|
avd_data_conversion_mode removed | String | Conversion Mode for AVD input data conversion. This key was removed. Support was removed in AVD version 5.0.0. |
|||
avd_data_validation_mode | String | error |
Valid Values: - error - warning |
Validation Mode for AVD input data validation. Input data validation will validate the input variables according to the schema. During validation, messages will generated with information about the host(s) and key(s) which failed validation. “error” will produce error messages and fail the task. “warning” will produce warning messages. |
# Validation Mode for AVD input data validation.
# Input data validation will validate the input variables according to the schema.
# During validation, messages will generated with information about the host(s) and key(s) which failed validation.
# "error" will produce error messages and fail the task.
# "warning" will produce warning messages.
avd_data_validation_mode: <str; "error" | "warning"; default="error">
Extensibility with Custom Templates¶
- Custom templates can be added below the playbook directory.
- If a location above the directory is desired, a symbolic link can be used.
-
Example under the
playbooks
directory create symbolic link with the following command:
- The output will be rendered at the end of the configuration.
- The order of custom templates in the list can be important if they overlap.
- It is recommenended to use a
!
delimiter at the top of each custom template.
Tip
The templates will have any host or group variable available to it.
If adding custom keys to an existing AVD data model, start the key with an underscore _
, so it will be ignored by schema validation.
Variable | Type | Required | Default | Value Restrictions | Description |
---|---|---|---|---|---|
custom_templates | List, items: String | - Custom templates can be added below the playbook directory. - If a location above the directory is desired, a symbolic link can be used. - Example under the playbooks directory create symbolic link with the following command:bash<br> ln -s ../../shared_repo/custom_avd_templates/ ./custom_avd_templates<br> - The output will be rendered at the end of the configuration. - The order of custom templates in the list can be important if they overlap. - It is recommended to use a ! delimiter at the top of each custom template.Add custom_templates to group/host variables: |
|||
- <str> | String | Template relative path below playbook directory. |
# - Custom templates can be added below the playbook directory.
# - If a location above the directory is desired, a symbolic link can be used.
# - Example under the `playbooks` directory create symbolic link with the following command:
#
# ```bash
# ln -s ../../shared_repo/custom_avd_templates/ ./custom_avd_templates
# ```
#
# - The output will be rendered at the end of the configuration.
# - The order of custom templates in the list can be important if they overlap.
# - It is recommended to use a `!` delimiter at the top of each custom template.
#
# Add `custom_templates` to group/host variables:
custom_templates:
# Template relative path below playbook directory.
- <str>
Generation of device configuration and documentation¶
The following settings can be leveraged to control generation of device configuration and documentation.
Variable | Type | Required | Default | Value Restrictions | Description |
---|---|---|---|---|---|
eos_cli_config_gen_configuration | Dictionary | ||||
enable | Boolean | True |
Generate device EOS configurations. | ||
hide_passwords | Boolean | False |
Replace the input data using the hide_passwords filter in the Jinja2 templates by ‘ |
||
eos_cli_config_gen_documentation | Dictionary | ||||
enable | Boolean | True |
Generate device Markdown documentation. | ||
hide_passwords | Boolean | True |
Replace the input data using the hide_passwords filter in the Jinja2 templates by ‘ |
||
generate_device_documentation deprecated | Boolean | True |
This key is deprecated. Support will be removed in AVD version 6.0.0. Use eos_cli_config_gen_documentation.enable instead. |
eos_cli_config_gen_configuration:
# Generate device EOS configurations.
enable: <bool; default=True>
# Replace the input data using the `hide_passwords` filter in the Jinja2 templates by '<removed>' in the configuration if true.
hide_passwords: <bool; default=False>
eos_cli_config_gen_documentation:
# Generate device Markdown documentation.
enable: <bool; default=True>
# Replace the input data using the `hide_passwords` filter in the Jinja2 templates by '<removed>' in the documentation if true.
hide_passwords: <bool; default=True>
# This key is deprecated.
# Support will be removed in AVD version 6.0.0.
# Use <samp>eos_cli_config_gen_documentation.enable</samp> instead.
generate_device_documentation: <bool; default=True>
Generate default config¶
The generate_default_config
setting controls the generation of some default EOS configurations.
This is historic behavior which has been disabled by default in AVD 5.0.0 and will be removed in AVD 6.0.0. Instead it is recommended to build structured config according to the intended output configurations.
The following commands will be generated when generate_default_config
is set to true
:
- RANCID Content Type
- Hostname (even if
hostname
variable is not set. Then the hostname is picked up frominventory_hostname
) - Default configuration
no aaa root
- Default configuration
no enable password
- Transceiver qsfp default mode
- End of configuration delimiter
Variable | Type | Required | Default | Value Restrictions | Description |
---|---|---|---|---|---|
generate_default_config deprecated | Boolean | False |
The generate_default_config knob allows to omit default EOS configuration.This can be useful when leveraging eos_cli_config_gen to generate configlets with CloudVision.The following commands will be omitted when generate_default_config is set to false :- RANCID Content Type - Hostname (even if hostname variable is not set. Then the hostname is picked up from inventory_hostname )- Default configuration for aaa - Default configuration for enable password - Transceiver qsfp default mode - End of configuration delimiter This key is deprecated. Support will be removed in AVD version 6.0.0. See here for details. |
# The `generate_default_config` knob allows to omit default EOS configuration.
# This can be useful when leveraging `eos_cli_config_gen` to generate configlets with CloudVision.
#
# The following commands will be omitted when `generate_default_config` is set to `false`:
#
# - RANCID Content Type
# - Hostname (even if `hostname` variable is not set. Then the hostname is picked up from `inventory_hostname`)
# - Default configuration for `aaa`
# - Default configuration for `enable password`
# - Transceiver qsfp default mode
# - End of configuration delimiter
# This key is deprecated.
# Support will be removed in AVD version 6.0.0.
# See [here](https://avd.arista.com/devel/docs/porting-guides/5.x.x.html#default-eos-configuration-is-no-longer-automatically-generated) for details.
generate_default_config: <bool; default=False>