Looping

Learn how to use Looping in SecuRA.

SecuRA supports loop based Templating using “for” loop statements

  1. "For Loop" Condition
  2.   
                      {% for interface_name in Runtime.interface_names %}
                          {% if {{interface_name}} == "GigabitEthernet0/0" %}
                                    IP address 192.168.1.1 255.0.0.0
                                    no shutdown
                          {% endif %}
                      {% endfor %}
    
                    
Substitution, Conditioning, Looping in Template should be in Jinja2 standard. Refer http://jinja.pocoo.org/docs/2.10/ for more tutorials.
Points to Remember:

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

Always enclose the variables inside {{ }} for substitution.