examples with the ipaddr filter
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
ipaddr_test.yml adding examples Jan 9, 2018


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
    sean_subnet: ""
    - 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

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