Über uns
Python network automation framework for generating, diffing, and deploying multi-vendor device configurations from NetBox and other Sources of Truth.
Systeme und InfrastrukturGemessener Sternzuwachs
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Verlauf wird gesammelt
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalAnnet - configuration generation and deploying utility for network equipment
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 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):
annet gen- generates the entire config for the specified devices or specified parts of itannet diff- first does gen and then builds diff with current config versionannet patch- first does diff and then generates a list of commands to apply diff on the deviceannet 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_PATHenv.~/.annet/context.yml.annet/configs/context.yml.
Config example:
generators:
default:
- my_annet_generators.example
storage:
default:
adapter: file
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.
Docker
Build the self-contained Annet image to run configuration preview/deployment or direct Gnetcli commands without installing Python/Go on the runtime host. The guide includes a file-inventory example and local smoke tests.
Installation
Install from PyPI:
pip install annet
Or install from source:
git clone https://github.com/annetutil/annet
cd annet
pip install -e .
Run without installation with Nix:
# latest:
nix run github:annetutil/annet/main -- --help
# specific version:
nix run github:annetutil/annet/v4.9.2 -- --help
Install using Nix flakes:
# add an input to your flake:
inputs."annet".url = "github:annetutil/annet/main";
# then add annet to the list of your packages:
environment.systemPackages = [
inputs."annet".packages.${pkgs.stdenv.hostPlatform.system}.annet
];
Use as python library in larger Nix project:
let
# apply the overlay:
pkgs = import inputs.nixpkgs {
system = system;
overlays = [ inputs."annet".overlays.default ];
};
in
pkgs.python3.withPackages (ps:
[ ps.annet ]
# install extras if needed:
++ ps.annet.optional-dependencies.netbox
)
Building doc
- Install dependencies:
pip install -r requirements-doc.txt
- Build
sphinx-build -M html docs docs-build
- Open rendered html in browser
open docs-build/html/index.html # macOS
xdg-open docs-build/html/index.html # Linux
start docs-build/html/index.html # Windows
Links
Ähnliche Projekte entdecken
Wird geladen…