Giter VIP home page Giter VIP logo

ipaddr_filter's Introduction

ipaddr filter examples

The ipaddr filter is a Jinja2 filter designed to provide an interface to netaddr. This github repo provides examples with the Ansible template module to augment the ipaddr documentation.

The Playbook

---
- hosts: localhost
  connection: local
  gather_facts: false
  vars:
    sean_subnet: "192.168.1.0/24"
  tasks:
    - template:
        src: ./template.j2
        dest: ./rendered

Running the playbook

Use the ansible-playbook command to run the included playbook.

[sean@rhel7]$ ansible-playbook ipaddr_test.yml

The playbook will create a local file called rendered which renders the included template.j2 which includes examples with the ipaddr filter.

View the playbook

Click here to view the playbook

View the rendered template

The rendered config will provider numerous examples. For example:

Jinja2:  What is the range of usable IP address on {{sean_subnet}}? {{ sean_subnet | ipaddr('range_usable') }}
Renders:  What is the range of usable IP address on 192.168.1.0/24? 192.168.1.1-192.168.1.254

Click here to view the rendered template


Red Hat Ansible Automation

Red Hat® Ansible® Automation includes three products:

  • Red Hat® Ansible® Engine: a fully supported product built on the foundational capabilities of the Ansible project.

  • Red Hat® Ansible® Networking Add-On: provides support for select networking modules from Arista (EOS), Cisco (IOS, IOS XR, NX-OS), Juniper (Junos OS), Open vSwitch, and VyOS.

  • Red Hat® Ansible® Tower: makes it easy to scale automation, manage complex deployments and speed productivity. Extend the power of Ansible with workflows to streamline jobs and simple tools to share solutions with your team.

Want more info? Read this blog post for more info about Engine, the networking add-on and Tower

ipaddr_filter's People

Contributors

ipvsean avatar

Watchers

James Cloos 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.