Giter Club home page Giter Club logo

Comments (4)

ShrutiVPawaskar avatar ShrutiVPawaskar commented on August 22, 2024

Introduction to Jinja2 and Junos PyEz

Part 1 – Intro to Jinja2

Discusses Jijna2 syntax

  • Template rendering
  • {% if %}
  • {% for %}
  • {% set %}

Part 2 – Into to PyEz

  • Connecting to a remote Junos device.
  • Getting configuration from the Junos device.
  • Loading configuration to the Junos device.

Part 3 –Configuring Junos Device using PyEz and Jinja2 Template

  • Creating Jinja2 template for Junos configuration.
  • Rendering Jinja2 template.
  • Pushing config to the Junos device using PyEz config module

Part 4 - Optimizing Configuration Push

  • Use Junos PyEz inbuilt function to render Jinja2 template and configure a single device
    with Config(dev, mode='private') as cu:
    cu.load(template=template, template_vars=template_vars, format='text')

Part 5 –Configuring multiple Junos devices using Jinja2 template

  • Use a single Jinja2 template
  • Use YAML file or Python dictionary as variables
  • Pushing basic config like hostname to multiple devices.

from nrelabs-curriculum.

Mierdin avatar Mierdin commented on August 22, 2024

@ShrutiVPawaskar This looks good, but I have one piece of important feedback. I'd like this to be split up into two lessons. Let's build a lesson totally focused on Jinja2, using the simplest possible software to illustrate examples. I'm thinking a little bit of YAML and Python to populate the templates, but the templates should be the focus. I'm thinking this would be a fundamentals lesson.

Separately from this, I'd like to see a lesson totally focused on PyEZ. It deserves its own lesson anyways, and putting it into the configuration course probably makes more sense at the moment.

Feel free to create a separate issue for the latter and write in the description that you're working on that as well.

from nrelabs-curriculum.

shahbhoomi avatar shahbhoomi commented on August 22, 2024

@Mierdin we have simplified the jinja2 lesson to make it fundamental and focus more on jinja2 templating. The lessons are as below:

  • Part 1: Intro to Jinja2 (variable substitution)
  • Part 2 : For Loops in Jinja2
  • Part 3: If and Set statements in Jinja2
  • Part 4: Populating Jinja2 template with YAML

from nrelabs-curriculum.

Mierdin avatar Mierdin commented on August 22, 2024

Awesome, thank you!

from nrelabs-curriculum.

Related Issues (20)

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.