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¶
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.
Any data validation issue will trigger errors - blocking further processing.
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
playbooksdirectory 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 ‘ |
||
| toc | Boolean | True |
Generate the table of content(TOC) on device documentation. | ||
| generate_device_documentation removed | Boolean | True |
This key was removed. Support was 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>
# Generate the table of content(TOC) on device documentation.
toc: <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
hostnamevariable 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 removed | 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 was removed. Support was removed in AVD version 6.0.0. See here for details. |