HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/ansible_collections/dellemc/os6/roles/os6_qos/templates/os6_qos.j2
#jinja2: trim_blocks: True,lstrip_blocks: True
{#####################################################

Purpose:
Configure qos commands for os6 Devices.

os6_qos:
  class_map:
    - name: CONTROL
      type: match-all
      match_condition:
        - ip dscp 40
      state: present
    - name: testclass
      type: match-all
      match_condition: 
        - vlan 4
      state: present
    - name: test
      type: match-any
      match_condition: 
        - vlan 5
      state: present
  policy_map:
    - name: testpolicy
      type: in
      class_instances:
        - name: testclass
          policy: 
            - assign-queue 4
            - mirror Po1
          state: present
        - name: test
          policy:
            - assign-queue 4
          state: present
      state: present

#####################################################}
{% if os6_qos is defined and os6_qos %}
{% for key in os6_qos.keys() %}
  {% if key =="class_map" %}
    {% for vars in os6_qos[key] %}
      {% if vars.name is defined and vars.name %}
        {% if vars.state is defined and vars.state == "absent" %}
no class-map {{ vars.name }}
        {% else %}
          {% if vars.type is defined and vars.type %}
class-map {{ vars.type }} {{ vars.name }}
          {% else %}
class-map {{ vars.name }}
          {% endif %}
          {% if vars.match_condition is defined and vars.match_condition %}
            {% for match in vars.match_condition %}
match {{ match }}
            {% endfor %}
          {% endif %}
exit
        {% endif %}
      {% endif %}
    {% endfor %}
  {% elif key =="policy_map" %}
    {% for vars in os6_qos[key] %}
      {% if vars.name is defined and vars.name %}
        {% if vars.state is defined and vars.state == "absent" %}
no policy-map {{ vars.name }}
        {% else %}
          {% if vars.type is defined and vars.type %}
policy-map {{ vars.name }} {{ vars.type }}
          {% else %}
policy-map {{ vars.name }}
          {% endif %}
          {% if vars.class_instances is defined and vars.class_instances %}
            {% for instance in vars.class_instances %}
              {% if instance.name is defined and instance.name %}
                {% if instance.state is defined and instance.state == "absent"%}
no class {{ instance.name }}
                {% else %}
class {{ instance.name }}
                {% endif %}
                {% if instance.policy is defined and instance.policy %}
                  {% for policy in instance.policy %}
{{ policy }}
                  {% endfor %}
                {% endif %}
exit
              {% endif %}
            {% endfor %}
          {% endif %}
exit
        {% endif %}
      {% endif %}
    {% endfor %}

  {% endif %}
{% endfor %}
{% endif %}