Skip to content

eos_cli_config_gen

Note

Always use the FQCN (Fully Qualified Collection Name) arista.avd.eos_cli_config_gen when using this plugin.

Generate AVD EOS device configurations and documentations

Synopsis

The arista.avd.eos_cli_config_gen module is an Ansible Action Plugin providing the following capabilities:

  • Validates input variables according to eos_cli_config_gen schema
  • Generates device configuration and saves it to file
  • Optionallu generates device documentation and saves it to file

Parameters

Argument Type Required Default Value Restrictions Description
structured_config_filename str optional None The path of the structured config to load. Required if read_structured_config_from_file is true.
config_filename str optional None The path to save the generated config to. Required if generate_device_config is true.
documentation_filename str optional None The path to save the generated documentation. Required if generate_device_doc is true.
read_structured_config_from_file bool optional True Flag to indicate if the structured config should be read from a file or not.
generate_device_config bool optional True Flag to generate the device configuration.
generate_device_doc bool optional True Flag to generate the device documentation.
device_doc_toc bool optional True Flag to generate the table of content for the device documentation.
conversion_mode str False debug Valid values:
- error
- warning
- info
- debug
- quiet
- disabled
Run data conversion in either "error", "warning", "info", "debug", "quiet" or "disabled" mode.
Conversion will perform type conversion of input variables as defined in the schema.
Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated.
During conversion, messages will be generated with information about the host(s) and key(s) which required conversion.
conversion_mode:disabled means that conversion will not run.
conversion_mode:error will produce error messages and fail the task.
conversion_mode:warning will produce warning messages.
conversion_mode:info will produce regular log messages.
conversion_mode:debug will produce hidden messages viewable with -v.
conversion_mode:quiet will not produce any messages.
validation_mode str False warning Valid values:
- error
- warning
- info
- debug
- disabled
Run validation in either "error", "warning", "info", "debug" or "disabled" mode.
Validation will validate the input variables according to the schema.
During validation, messages will be generated with information about the host(s) and key(s) which failed validation.
validation_mode:disabled means that validation will not run.
validation_mode:error will produce error messages and fail the task.
validation_mode:warning will produce warning messages.
validation_mode:info will produce regular log messages.
validation_mode:debug will produce hidden messages viewable with -v.
cprofile_file str False None Filename for storing cprofile data used to debug performance issues.
Running cprofile will slow down performance in it self, so only set this while troubleshooting.

Examples

---
- name: Generate eos intended configuration and device documentation
  arista.avd.eos_cli_config_gen:
    structured_config_filename: "{{ structured_config_filename }}"
    config_filename: "{{ eos_config_dir }}/{{ inventory_hostname }}.cfg"
    documentation_filename: "{{ devices_dir }}/{{ inventory_hostname }}.md"
    read_structured_config_from_file: true
  delegate_to: localhost
  vars:
    structured_config_filename: "{{ structured_dir }}/{{ inventory_hostname }}.{{ avd_structured_config_file_format }}"
- name: Generate device documentation only
  arista.avd.eos_cli_config_gen:
    structured_config_filename: "{{ structured_config_filename }}"
    config_filename: "{{ eos_config_dir }}/{{ inventory_hostname }}.cfg"
    documentation_filename: "{{ devices_dir }}/{{ inventory_hostname }}.md"
    read_structured_config_from_file: true
    generate_device_config: false
    device_doc_toc: true
  delegate_to: localhost
  vars:
    structured_config_filename: "{{ structured_dir }}/{{ inventory_hostname }}.{{ avd_structured_config_file_format }}"

Authors

  • Arista Ansible Team (@aristanetworks)