<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Template Editor - jinja2 ipaddr filter in Cisco Catalyst Center</title>
    <link>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/4621469#M5505</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/82303"&gt;@Preston Chilcote&lt;/a&gt;&amp;nbsp;I have submitted a Make a Wish from both our Lab and our Production instance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; &amp;nbsp;No one has yet to reach out, so I posted here to see if anyone had worked through it already.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking forward to future updates for this product.&lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2022 13:23:30 GMT</pubDate>
    <dc:creator>Doug Byrd</dc:creator>
    <dc:date>2022-05-31T13:23:30Z</dc:date>
    <item>
      <title>Template Editor - jinja2 ipaddr filter</title>
      <link>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/4618762#M5479</link>
      <description>&lt;P&gt;I'm working with some Jinja2 templates and have a need to use Jinja2's 'ipaddr' filter.&amp;nbsp; Since this isn't well documented from a DNAC perspective, I've been trying to use some of the attributes/schema that are present in the Ansible version of ipaddr.&amp;nbsp; I've got the basics working, but I seem to be getting stuck on the syntax for choosing an index/ipaddress in a network.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this working properly:&lt;/P&gt;&lt;PRE&gt;{% set network = '192.168.2.5/22' %}

Input: {{ network }}
Network Address: {{ network | ipaddr('network') }}
Address: {{ network | ipaddr('address') }}
Netmask: {{ network | ipaddr('netmask') }}
Prefix: {{ network | ipaddr('prefix') }}
Broadcast: {{ network | ipaddr('broadcast') }}&lt;/PRE&gt;&lt;PRE&gt;Input: 192.168.2.5/22
Network Address: 192.168.0.0
Address: 192.168.2.5
Netmask: 255.255.252.0
Prefix: 22
Broadcast: 192.168.3.255&lt;/PRE&gt;&lt;P&gt;What I want to be able to do is address an IP address by it's index.&amp;nbsp; For example, in Ansible I can programmatically choose the gateway to be the first usable ip address in a network by using something like:&lt;/P&gt;&lt;PRE&gt;{% set network = "192.168.1.0/24" %}
HSRP IP: {{ network | ipaddr(1) | ipaddr('address') }}
Router 1: {{ network | ipaddr(2) | ipaddr('address') }}
Router 2: {{ network | ipaddr(3) | ipaddr('address') }}&lt;BR /&gt;LB VIP: {{ network | ipaddr(-2) | ipaddr('address') }}&lt;BR /&gt;LB1: {{ network | ipaddr(-3) | ipaddr('address') }}&lt;BR /&gt;LB2: {{ network | ipaddr(-4) | ipaddr('address') }}&lt;/PRE&gt;&lt;PRE&gt;HSRP IP: 192.168.1.1
Router 1: 192.168.1.2
Router 3: 192.168.1.3
LB VIP: 192.168.1.254
LB1: 192.168.1.253
LB2: 192.168.1.252&lt;/PRE&gt;&lt;P&gt;Am I just missing the proper syntax, or is this functionality even available?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 18:09:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/4618762#M5479</guid>
      <dc:creator>Doug Byrd</dc:creator>
      <dc:date>2022-05-26T18:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Template Editor - jinja2 ipaddr filter</title>
      <link>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/4619443#M5485</link>
      <description>&lt;P&gt;In principle, the Cisco DNA jinja editor should allow copy/paste from your Ansible jinja templates. &amp;nbsp;Please submit a Make a Wish via the GUI's help menu to let the development team know of this missing feature. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 19:42:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/4619443#M5485</guid>
      <dc:creator>Preston Chilcote</dc:creator>
      <dc:date>2022-05-27T19:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Template Editor - jinja2 ipaddr filter</title>
      <link>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/4621469#M5505</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/82303"&gt;@Preston Chilcote&lt;/a&gt;&amp;nbsp;I have submitted a Make a Wish from both our Lab and our Production instance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; &amp;nbsp;No one has yet to reach out, so I posted here to see if anyone had worked through it already.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking forward to future updates for this product.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 13:23:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/4621469#M5505</guid>
      <dc:creator>Doug Byrd</dc:creator>
      <dc:date>2022-05-31T13:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Template Editor - jinja2 ipaddr filter</title>
      <link>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/5357286#M13860</link>
      <description>&lt;P&gt;Did Cisco every grant your wish?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 14:07:13 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cisco-catalyst-center/template-editor-jinja2-ipaddr-filter/m-p/5357286#M13860</guid>
      <dc:creator>minkij</dc:creator>
      <dc:date>2025-12-23T14:07:13Z</dc:date>
    </item>
  </channel>
</rss>

