Skip to content

Environment variables

Environment Variables in eos-downloader

Overview

ardl is able to read environment variables to replace cli option to make it easier to work with in workflow. Even if all cli options can be replaced by environment variables, here are the most useful ones:

Standard rule for these variables is:

# root command
ARISTA_<OPTION_NAME>

# First Level command
ARISTA_<COMMAND_NAME>_<OPTION_NAME>

# Second level command
ARISTA_<COMMAND_NAME>_<COMMAND_NAME>_<OPTION_NAME>

How to get variable names

Standard ENV variables are exposed in cli help and are visible with [env var: ARISTA_GET_EOS_DOCKER_TAG]

Standard Variables

Generic Options:

  • ARISTA_TOKEN (ardl --token): Load your token and avoid to print your token in clear text during a workflow.

EOS Options:

  • ARISTA_GET_EOS_FORMAT (ardl get eos --format): Image format
  • ARISTA_GET_EOS_OUTPUT (ardl get eos --output): Path to save EOS image.
  • ARISTA_GET_EOS_VERSION (ardl get eos --version): Version to download from Arista server
  • ARISTA_GET_EOS_BRANCH (ardl get eos --latest): Flag to retrieve latest version available from arista server.
  • ARISTA_GET_EOS_BRANCH (ardl get eos --branch): Branch to download
  • ARISTA_GET_EOS_EVE_NG (ardl get eos --eve-ng): Run EVE-NG vEOS provisioning (only if CLI runs on an EVE-NG server).
  • ARISTA_GET_EOS_DOCKER_NAME (ardl get eos --docker-name): Docker image name when importing cEOS.
  • ARISTA_GET_EOS_DOCKER_TAG (ardl get eos --docker-tag): Docker tag to use when cEOS image is imported in Docker.
  • ARISTA_GET_EOS_RELEASE_TYPE (ardl get eos --release-type): Release type (M for Maintenance, F for Feature)

CVP options:

  • ARISTA_GET_CVP_FORMAT (ardl get cvp --format): Image format
  • ARISTA_GET_CVP_OUTPUT (ardl get cvp --output): Path to save CVP image.
  • ARISTA_GET_CVP_LATEST (ardl get cvp --latest): Flag to retrieve latest version available from arista server.
  • ARISTA_GET_CVP_VERSION (ardl get cvp --version): Version to download from Arista server
  • ARISTA_GET_CVP_BRANCH (ardl get cvp --branch): Branch to download

Usage examples

  • Basic usage with export
# Use token from env variables
export ARISTA_TOKEN=1234567890
ardl info versions --branch 4.29
  • Usage with direnv
cat .envrc
export ARISTA_TOKEN=1234567890

direnv allow
direnv: loading .envrc
direnv: export +ARISTA_TOKEN

ardl info versions --branch 4.29