Skip to content

Latest commit

 

History

History
137 lines (96 loc) · 5.67 KB

collection-installation.md

File metadata and controls

137 lines (96 loc) · 5.67 KB

Collection installation

Installation workflow

  • Install Python 3.8 or later
  • Install ansible-core from 2.12.6 to 2.14.x excluding 2.13.0 !!! note Excluded version 2.13.0 has an issue in ansible-core, which is fixed in 2.13.1. Plugin loader will now load config data for plugin by name instead of by file to avoid issues with the same file being loaded under different names (Fully-Qualified-Collection-Name + short-name).
  • Install arista.avd collection
  • Install additional Python requirements
  • Modify ansible.cfg file to support additional jinja2 extensions

Install Collection from Ansible Galaxy

These instructions are for regular users to install via Ansible Galaxy. To setup a development environment use these instructions. arista.avd can also be consumed using the "AVD All-in-one" container. The arista.avd collection is available on Ansible Galaxy server and can be automatically installed on your system.

Latest version

ansible-galaxy collection install arista.avd

!!! warning If you have an ansible.cfg file in the directory where you run ansible-galaxy, it may affect the directory under which the collection and dependencies will be installed.

Install a specific version

ansible-galaxy collection install arista.avd:==3.6.0

You can specify multiple range identifiers which are split by ,. For example, you can use the following range identifiers:

  • *: Any version, this is the default used when no range specified is set.
  • !=: Version isn't equal to the one specified.
  • ==: Version must be the one specified.
  • >=: Version is greater than or equal to the one specified.
  • >: Version is greater than the one specified.
  • <=: Version is less than or equal to the one specified.
  • <: Version is less than the one specified.

!!! note If you are installing with a range command, you must surround the command in quotes. For example, ansible-galaxy collection install 'arista.avd:>=3.0.0,<3.6.0'

Install latest devel version from AVD GitHub

ansible-galaxy collection install git+https://github.com/aristanetworks/ansible-avd.git#/ansible_collections/arista/avd/,devel

!!! note Collection dependencies like ansible-cvp will be installed from ansible-galaxy unless installed first using similar GitHub source.

Install in a specific directory

If you want to install collection in a specific directory part of your project, you can call ansible-galaxy and update your ansible.cfg

# Install collection under ${PWD/collections/}
$ ansible-galaxy collection install arista.avd -p collections/

# Update ansible.cfg file
$ vim ansible.cfg
collections_paths = ${PWD}/collections:~/.ansible/collections:/usr/share/ansible/collections

Upgrade installed AVD collection

!!! note You can use -U to upgrade to a new version for any installed collection:

$ ansible-galaxy collection install -U arista.avd
Process install dependency map
Starting collection install process
Installing 'arista.avd:3.6.0' to '/root/.ansible/collections/ansible_collections/arista/avd'

!!! warning After an upgrade, some python requirements may have changed. Follow the instructions in the Python requirements section to update your python packages.

!!! note You can find some additional information about how to use Ansible's collections on the following Ansible pages:

- [Ansible collection user guide](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html)
- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)

Additional Python Libraries required

--8<--
requirements.txt
--8<--

Python requirements installation

In a shell, run the following commands after installing the collection from ansible-galaxy:

export ARISTA_AVD_DIR=$(ansible-galaxy collection list arista.avd --format yaml | head -1 | cut -d: -f1)
pip3 install -r ${ARISTA_AVD_DIR}/arista/avd/requirements.txt

If the collection is cloned from GitHub, we can reference the requirements file directly:

pip3 install -r ansible-avd/ansible_collections/arista/avd/requirements.txt

!!! warning Depending of your operating system settings, pip3 might be replaced by pip.

Ansible configuration file

  • Enable Jinja2 extensions: loopcontrols and do
  • By default, Ansible will issue a warning when a duplicate dict key is encountered in YAML. We recommend to change to error instead and stop playbook execution when a duplicate key is detected.
jinja2_extensions=jinja2.ext.loopcontrols,jinja2.ext.do
duplicate_dict_key=error

Arista EOS requirements

  • EOS 4.21.8M or later
  • Roles validated with eAPI transport -> ansible_connection: httpapi

Arista CloudVision requirements

If you leverage CloudVision deployment with AVD, your CV instance must be supported by CloudVision Ansible collection

!!! note When using ansible-cvp modules, the user who is executing the ansible-playbook must have access to both CVP and the EOS CLI.