Infraon Infinity
API DocsAdmin GuideUser GuideVideo LibraryResources
  • Infraon Documentation
  • Explore More
    • What's New
    • Use Cases
      • Dashboard
        • Default Dashboard
        • Add a Dashboard
        • Miscellaneous
      • Asset
        • IT & Fixed Asset
          • Asset Categories
          • Add Asset
            • Adding an Asset Manually
            • Adding an asset using CSV
            • Adding an asset using Inventory Agent
          • Miscellaneous
        • Software Inventory
        • Software License Management
        • CMDB view
      • Ticket Management
        • Ticket Creation
          • Created by Techician
          • Email to incident
          • Self Service Portal
          • Trigger Configuration
        • Ticket Assignment
          • Ticket Assignment (Manual)
          • Ticket Assignment (Automatic)
        • Ticket Resolution
        • Miscellaneous
    • Handbooks
    • Video Library: Infraon Infinity
      • Dashboard
      • Assets
        • IT & Fixed Asset
          • Add an Asset
        • Software Inventory
        • Software License
        • CMDB View
      • Ticket Management
        • Ticket Creation
        • Ticket Assignment
        • Ticket Resolution
        • Miscellaneous
      • Request Management
      • Problem Management
      • Change Management
      • Release Management
      • Event Management
      • Report
      • SLA Management
      • Network Diagram
      • Topology
      • Geomap
      • Infraon Configuration
        • General Settings
        • User Management
        • Service Management
        • Notifications
        • Infraon Automation
        • Bots
        • Organization
        • IT Operations
          • Advance Resource Configuration
          • Blacklist and Whitelist
          • Discovery
          • Diagnosis Tools
          • Device Credentials
          • Maintenance
          • Correlation Rules
          • Network Configuration
          • Thresholds
  • Infinity Admin Guide
    • Overview
    • Getting Started
      • Welcome to Infraon!
      • Know Infraon!
      • User's first login
  • Infraon Platform
    • Account Signup
    • CI Rule Configuration
    • Infraon URL
    • Login Settings
    • Module Prefix Configuration
    • Rebrand Infraon
    • Template Configuration
    • Vendor
    • SSP Configuration
  • Infinity User Guide
    • Introduction
    • Workspace
    • Dashboard
      • Widgets
      • Add a Dashboard
    • Asset
      • Asset Lifecycle
      • How does it work?
      • Asset Types
      • Asset Categories/Sub-Categories
      • Asset Grid Page
      • Add Asset/Add Item
      • Asset Information – SDH / PDH
      • Consumable Asset (Beta)
      • Software Assets
      • Software License
      • CMDB View
        • CI relationship in CMDB Downstream
        • CI relationship in CMDB Upstream
    • Contract Management
      • Add contract
    • NCCM
      • Download Job
      • Calendar View
    • IMACD (Beta)
      • Instructions to add a process
      • Gate pass
    • Ticket Management
      • Tickets
      • Add ticket
    • Request Management
      • Request
      • Add Request
    • Problem Management
      • Problem
      • Add Problem
    • Change Management
      • Change
      • Add Change
    • Log Management
      • Log Search
      • Log Stream
    • Release Management
      • What you see on the screen
      • Instructions to add a New Release
    • Event Management
      • Events
    • Report
      • How does it work
      • Add Report
    • Knowledge Base
      • Infraon's Knowledge Base
    • SLA Management
      • SLA
      • Profile
    • Geomap
      • What you see on the screen
    • Network Diagram (Beta)
      • How does it work?
    • Topology
      • Topological Links
    • Infraon Configuration
      • General Settings
        • Audits
        • Business Hours
        • Tag Management
        • API Registration
      • User Management
        • Department
        • Active users
        • Leaves
        • My Leaves
        • Password Policy
        • Requesters
        • Roles & Privileges
        • Teams
        • Users
        • Shift Configuration
      • Service Management
        • Service Catalogue
      • Notifications
        • Configure SMS
        • Configure SMTP
        • Messenger Audit
        • Trigger Configuration
      • Infraon Automation
        • Business Rule
          • Manual Service Mapping
        • Escalation
        • Email Integration
        • Customer Feedback Template
        • Mail Automator
        • Microsoft Outlook
        • Workflow
          • Advanced Options
          • Task Workflow
      • Bots
        • Bots assistance
        • Data Collector
        • Inventory Agent
      • Organization
        • Address Book
        • License
        • Asynchronous Task Manager
      • IT Operations
        • Advance Resource Configuration
        • Blacklist and Whitelist
        • CLI Jobs
        • Circuit Discovery
        • Device Credentials
        • Diagnosis Tools
        • Discovery
          • Automatic Discovery
          • Network Discovery
          • Windows Servers
          • Linux Servers
          • Hypervisor Monitoring
          • VMware
          • URL/ Web Services
          • Wireless Controller
        • Job Progress
        • Maintenance
        • Network Configuration
          • Baseline Scheduler
          • Configuration Comparison
          • Configuration File Compare
          • Configuration Parameters
          • Configuration Profile
          • Configuration Search
          • Configuration Template
            • What you see on the screen
            • How to write Command Portion in Template
            • Conditioning in Template
            • Guidelines for Configuration Template
            • Add Template
              • Miscellaneous
          • Generate MD5
          • Jobs Account Audit
          • OS Image
            • OS Image Download Scheduler
          • Configuration Trigger
          • Job(s) Retry Queue
          • Workflow Jobs
          • Rules
          • Rule Group
          • Policy
          • Manage Vulnerabilities
            • Vulnerabilities by CVE
            • Vulnerabilities by Assets
            • Vulnerabilities Database
          • Download Jobs
            • What you see on the screen
            • Add Download Job
          • Upload Jobs
            • What you see on the screen
            • Add Upload Job
          • Service Template
            • Service Job
          • Authentication Profile
          • Authorization Profile
        • Rules
          • Log Rule
          • Correlation Rule
        • Thresholds
        • Trap Configuration
      • Log Management
        • Log Multi-Index
        • Log Search
        • Log Stream
        • Export Configs
    • Marketplace (Beta)
      • Azure Active Directory
      • Infraon Dell
      • Google Workspace
      • Infraon JAMF
      • Infraon ServiceNow
      • Infraon Slack
      • Infraon Teams
      • Infraon WhatsApp
      • Infraon Ring Central
      • Infraon LDAP
      • Infraon JIRA
Powered by GitBook
On this page
  • Points to Remember
  • Sample Template Configuration

Was this helpful?

  1. Infinity User Guide
  2. Infraon Configuration
  3. IT Operations
  4. Network Configuration
  5. Configuration Template

Guidelines for Configuration Template

#Substitution, Conditioning, and Looping in the Template should be in the Jinja2 standard. For more tutorials, refer to http://jinja.pocoo.org/docs/2.10/.

Points to Remember

Always enclose the commands within {% %} for "if," and "for," and "while" conditional statements

Always enclose the variables inside {{ }} for substitution

Sample Template Configuration

Example 1: Create an Empty List, add values to the List, and DO a simple ‘For Loop’

# Declaring a string variable to store value from Runtime or user. The default (“”) function will make the variable empty string till the USER input

{% set myinput = Runtime.interface_list | default(“”) %}

# Converting User Input to a list using the Split function

{% set mylist = myinput .split(",") %}

#Doing for Loop or Looping of Each Item

{% for each_interface in mylist %}
      <command prompt="#">int {{each_interface}}</command>
      <command prompt="#">shutdown</command>

# for requires endfor to close the section

{% endfor %}

Example 2: Conditions (if case elif Case and else case)

{% for each_interface in mylist %}
        {% if each_interface == "Gi0/1" %}
                  <command prompt="#">int {{each_interface}}</command>
                  <command prompt="#">shutdown</command>
        {% elif each_interface == "Gi0/2" %}
                   <command prompt="#">int {{each_interface}}</command>
                   <command prompt="#">no shutdown</command>
        {% else %}
                    <command prompt="#">I dont know</command>
        {% endif %}
{% endfor %}

Example 3: Taking List Input from a Trigger

#down_interface_list_cisco_ios is a Trigger in Configuration Trigger

{% set mylist1 = Trigger.down_interface_list_cisco_ios | default([]) %}
{% for each_interface in mylist1 %}
      <command prompt="#">int {{each_interface}}</command>
      <command prompt="#">shutdown</command>
{% endfor %}

Example 4: Disable the Interface named ‘Ether’

# String Manipulation startswith, endswith, find, lower, upper, strip

{% set myinput = Runtime.InterfaceNames | default ("") %}
{% set mylist = myinput.split(",") %}
{% for each_item in mylist %}
      {% if each_item.lower().startswith("ether") %}        
            <command prompt="#">int {{each_item}}</command>
            <command prompt="#">shutdown</command>
   {% endif %}
{% endfor %}

Example 5: Taking the First Element from the Trigger

{% set mylist = Trigger.down_interface_list_cisco_ios |default ([]) %}\

{% if mylist %}
    <command timeout ="10" prompt ="#" >config t</command>        
    <command timeout ="10" prompt ="#" >interface {{mylist[0]}} </command>
    <command timeout="10" prompt  ="#" >IP address 172.17.230.2    
255.255.255.252</command>
     <command timeout ="10" prompt  ="#" >no shut</command>
{% endif %}

PreviousConditioning in TemplateNextAdd Template

Last updated 8 months ago

Was this helpful?