Code Monkey home page Code Monkey logo

cisco-configuration-using-python-jinja-csv's Introduction

published Tested on Python 3.9.4 Contributions Welcome License Code style: black

Generate Cisco Configuration Template Using Python3, Jinja2, and CSV with Validation

This program is designed to generate a configuration template for Cisco Catalyst/Nexus switches.

Table of Contents

  1. Requirements
  2. Getting Started
  3. Installation
  4. Usage
  5. Preview
  6. Helpful Tips
  7. TODOs

Requirements

  1. Python @3.9.4
  2. Jinja2 @2.11.3

Getting Started

│   cisco_config_generator.py
│   cisco_validation.py
│   switch.j2
│   requirements.txt
│   README.md
│   .gitignore
│   LICENSE
│
├───assets
│       preview.png
│
├───configs
│       .gitkeep
│
└───CSV
        01_params.csv
        02_vlans.csv
        03_etherchannels.csv
        04_port_mapping.csv

Installation

$ git clone https://github.com/Tes3awy/Cisco-Configuration-Using-Python-Jinja-CSV.git
$ cd Cisco-Configuration-Using-Python-Jinja-CSV
$ pip install -r requirements.txt

Usage

  1. Open each .csv file respectively and add the configurations that meet your needs. (The CSV files are populated with a sample configuration already)
  2. Open terminal/cmd.
  3. Run python cisco_config_generator.py.

First, a json_schema.json file is created (if not created already) from your configuration in CSV files. Then, json_schema.json is validated against a set of rules in cisco_validation.py.

Voila ✨! Your configuration will be created an placed in configs directory.

Preview

Preview

Helpful Tips

  1. DO NOT copy/paste the whole configuration all at once to your device. Divide the configuration template into multiple sections.
  2. Always save your configuration with the copy running-config startup-config command. Why?!

TODOs

  • Validate input fields in CSV files.

cisco-configuration-using-python-jinja-csv's People

Contributors

tes3awy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.