<?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 Best way to create golden configs with Python/Jinja2? in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4822601#M998</link>
    <description>&lt;P&gt;I would like to create a Python job using Jinja2 templates to create golden configs. This is easy enough, but my question is should I use one large template for the entirety of the config or split it into multiple templates (base, snmp, ntp, aaa, etc). I ask for a few reasons...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I would like a single job for multiple switch types with require different interface syntax.&lt;/LI&gt;&lt;LI&gt;If I wanted to do something like add a new SNMP account, having the config ready in a snippet just for SNMP would save time without having to generate a complete config.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;I would eventually like to migrate to Ansible and I feel like having the sections already split would help that transition.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any other Python method I should consider here? Thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Apr 2023 00:57:33 GMT</pubDate>
    <dc:creator>Josh Morris</dc:creator>
    <dc:date>2023-04-27T00:57:33Z</dc:date>
    <item>
      <title>Best way to create golden configs with Python/Jinja2?</title>
      <link>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4822601#M998</link>
      <description>&lt;P&gt;I would like to create a Python job using Jinja2 templates to create golden configs. This is easy enough, but my question is should I use one large template for the entirety of the config or split it into multiple templates (base, snmp, ntp, aaa, etc). I ask for a few reasons...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I would like a single job for multiple switch types with require different interface syntax.&lt;/LI&gt;&lt;LI&gt;If I wanted to do something like add a new SNMP account, having the config ready in a snippet just for SNMP would save time without having to generate a complete config.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;I would eventually like to migrate to Ansible and I feel like having the sections already split would help that transition.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any other Python method I should consider here? Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 00:57:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4822601#M998</guid>
      <dc:creator>Josh Morris</dc:creator>
      <dc:date>2023-04-27T00:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create golden configs with Python/Jinja2?</title>
      <link>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4822763#M999</link>
      <description>&lt;P&gt;This was always my preferred way. We use to split the j2 files into areas such as security (ACL for example) BGP to providers, BGP to peerings etc, we had a bare base config too such as mgmt ip and usernames. You are right imo, managing one large j2 file and having this as your source of truth with what would be many changes per day and lets face it some of our running-configs get huge, smaller changes work much better.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 06:48:01 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4822763#M999</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2023-04-27T06:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create golden configs with Python/Jinja2?</title>
      <link>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4823025#M1000</link>
      <description>&lt;P&gt;It does, thanks. So each config section is its own j2 template, then the python takes the variable input and combines all the j2 templates into one large template to be put on a switch?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 13:13:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4823025#M1000</guid>
      <dc:creator>Josh Morris</dc:creator>
      <dc:date>2023-04-27T13:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to create golden configs with Python/Jinja2?</title>
      <link>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4823057#M1001</link>
      <description>&lt;P&gt;Yes sir, this is the way. I think i had an example with Napalm here back in the day as a jinja helper &lt;A href="https://github.com/CiscoDevNet/learning_lab_napalm_code/blob/master/jinja_helper.py" target="_blank"&gt;https://github.com/CiscoDevNet/learning_lab_napalm_code/blob/master/jinja_helper.py&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:04:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/best-way-to-create-golden-configs-with-python-jinja2/m-p/4823057#M1001</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2023-04-27T14:04:55Z</dc:date>
    </item>
  </channel>
</rss>

