https://github.com/annetutil/annet
Configuration generation and deploying utility for network equipment
https://github.com/annetutil/annet
automation network-automation
Last synced: 2 months ago
JSON representation
Configuration generation and deploying utility for network equipment
- Host: GitHub
- URL: https://github.com/annetutil/annet
- Owner: annetutil
- License: mit
- Created: 2023-10-20T20:56:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-26T17:01:01.000Z (3 months ago)
- Last Synced: 2026-03-27T06:55:00.566Z (3 months ago)
- Topics: automation, network-automation
- Language: Python
- Homepage: https://annetutil.github.io/annet/
- Size: 2.24 MB
- Stars: 174
- Watchers: 11
- Forks: 56
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# Annet - configuration generation and deploying utility for network equipment
[](https://t.me/annet_sup)
[](https://pypi.python.org/pypi/annet)
[](https://pypistats.org/packages/annet)
[](https://github.com/annetutil/annet/blob/master/LICENSE)
[](https://github.com/annetutil/annet/actions)
[](https://annetutil.github.io/annet)
Annet is a configuration generator that can translate differences between old and new configurations into sequence 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 `gen`erates configuration for a device by running Python code, which usually goes to the Network Source of Truth, like NetBox. Annet then gets the `diff`erence by getting the configuration from the device and comparing it. Finally, Annet translates the difference into a sequence of commands, called a `patch`. After `deploy`ing these commands, the diff will be empty.
Annet has a number of modes (subcommands):
- ```annet gen``` - generates the entire config for the specified devices or specified parts of it
- ```annet diff``` - first does gen and then builds diff with current config version
- ```annet patch``` - first does diff and then generates a list of commands to apply diff on the device
- ```annet deploy``` - first does patch and then deploys it to the device
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:
- `ANN_CONTEXT_CONFIG_PATH` env.
- `~/.annet/context.yml`.
- `annet/configs/context.yml`.
Config example:
```yaml
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.
## Installation
Install from PyPI:
```shell
pip install annet
```
Or install from source:
```shell
git clone https://github.com/annetutil/annet
cd annet
pip install -e .
```
## Building doc
1. Install dependencies:
```shell
pip install -r requirements-doc.txt
```
2. Build
```shell
sphinx-build -M html docs docs-build
```
3. Open rendered html in browser
```shell
open docs-build/html/index.html # macOS
xdg-open docs-build/html/index.html # Linux
start docs-build/html/index.html # Windows
```
## Links
* [Online Documentation](https://annetutil.github.io/annet/)
* [Tutorial](https://annetutil.github.io/annet/main/usage/tutorial.html)