https://github.com/ngschmidt/netconfig-sourdough-starter
Automatically generating network configurations isn't as hard as you think! Copy this repository template and start adding `kinds` to quickly automate any network configuration process you might have.
https://github.com/ngschmidt/netconfig-sourdough-starter
Last synced: 9 months ago
JSON representation
Automatically generating network configurations isn't as hard as you think! Copy this repository template and start adding `kinds` to quickly automate any network configuration process you might have.
- Host: GitHub
- URL: https://github.com/ngschmidt/netconfig-sourdough-starter
- Owner: ngschmidt
- License: gpl-3.0
- Created: 2021-05-29T01:40:46.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-01T05:21:16.000Z (about 5 years ago)
- Last Synced: 2025-06-26T22:19:49.524Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Network Device Builder
## Goal
Construct a network configuration from basic facts (`kinds`) and a configuration template.
## Overview
### Validation
Intuitively providing a way to validate what's missing in a device definition is pretty important. Dumping a starter file is even better.
### Unit Testing
We want to construct *and automatically test* any non-factory (e.g. not provided by Jinja) capabilities to ensure quality is up to snuff. The approach here *MUST* be eminently testable.
This will be achieved by performing an end-to-end test against truth tables - all `kinds` should be iterable, providing the following objects under `testing`:
```bash
{{ kind }}-test.yml
{{ kind }}-truth.txt
```
This is required to ensure that end-results are consistent, and isn't just a test of code provided in this repository - if a dependency breaks, we'll see it in a pipeline prior to production usage.
### Hardware Portfolio
Located in `kinds`. The eventual goal here is to use YAML Front Matter (YFM) to document `kinds` in-line as a markdown file.
## HOWTO
Generate your `kind` device definition starter:
```bash
python3 net-starter.py -gen-kind {{ kind }}
```
Add your variables, then run again:
```bash
python3 net-starter.py -i {{ variablefile }}
```
Ideally, store the variable file in a source of truth like [Netbox](https://netbox.readthedocs.io/en/stable/) for safe keeping!
## Dependencies
* `cerberus`
* `jinja2`
* `JSON`
* `ruamel.YAML`