Skip to content

inventory_to_container

Transform information from inventory to arista.cvp collection

Module added in version 2.9

Synopsis

Transform information from ansible inventory to be able to provision CloudVision Platform using arista.cvp collection and its specific data structure.

Module-specific Options

The following options may be specified for this module:

parameter type required default choices comments
configlet_dir
str no
Directory where intended configurations are located.
configlet_prefix
str no
Prefix to put on configlet.
container_root
str yes
Ansible group name to consider to be Root of our topology.
destination
str no
Optional path to save variable.
device_filter
list no ['all']
Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. device_filter list devices that can be modified or deleted based on configlets entries.
inventory
str yes
YAML inventory file


Examples

- name: generate intended variables
  inventory_to_container:
    inventory: 'inventory.yml'
    container_root: 'DC1_FABRIC'
    configlet_dir: 'intended_configs'
    configlet_prefix: 'AVD'
    device_filter: ['DC1-LE']
    # destination: 'generated_vars/{{inventory_hostname}}.yml'
  register: CVP_VARS

- name: 'Collecting facts from CVP {{inventory_hostname}}.'
  arista.cvp.cv_facts:
  register: CVP_FACTS

- name: 'Create configlets on CVP {{inventory_hostname}}.'
  arista.cvp.cv_configlet:
    cvp_facts: "{{CVP_FACTS.ansible_facts}}"
    configlets: "{{CVP_VARS.CVP_CONFIGLETS}}"
    configlet_filter: ["AVD"]

- name: "Building Container topology on {{inventory_hostname}}"
  arista.cvp.cv_container:
    topology: '{{CVP_VARS.CVP_TOPOLOGY}}'
    cvp_facts: '{{CVP_FACTS.ansible_facts}}'
    save_topology: true

Author

  • Ansible Arista Team (@aristanetworks)

Status

This module is flagged as preview which means that it’s not guaranteed to have a backwards compatible interface.


Last update: November 24, 2022