annetutil / annet

configuration generation and deploying utility for network equipment
https://annetutil.github.io/annet/
MIT License
49 stars 19 forks source link
automation network-automation

Annet - configuration generation and deploying utility for network equipment

Annet is a configuration generator that can translate differences between old and new configurations into sequnce of commands. This feature is vital for CLI-based devices, such as Huawei, Cisco IOS, Cisco NX-OS, Juniper. Devices configured via separate config files, Linux, FreeBSD and Cumulus are also supported.

It works this way. Annet generates configuration for a device by running Python code, which usually goes to the Network Source of Truth, like NetBox. Annet then gets the difference by getting the configuration from the device and comparing it. Finally, Annet translates the difference into a sequence of commands, called a patch. After deploying these commands, the diff will be empty.

Annet has a number of modes (subcommands):

Usage help can be obtained by calling annet -h or for a specific command, such as annet gen -h.

Configuration

The path to the configuration file is searched in following order:

Config example:

generators:
  default:
    - my_annet_generators.example

storage:
  default:
    adapter: annet.adapters.file.provider
    params:
      path: /path/to/file

context:
  default:
    generators: default
    storage: default

selected_context: default

Environment variable ANN_SELECTED_CONTEXT can be used to override selected_context parameter.

Building doc

  1. Install dependencies:
pip install -r requirements-doc.txt
  1. Build
sphinx-build -M html docs docs-build
  1. Open rendered html in browser docs-build/html/index.html