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/os10/roles/os10_lag/templates/os10_lag.j2
#jinja2: trim_blocks: True,lstrip_blocks: True
{################################
Purpose:
Configure LAG commands for os10 Devices.
os10_lag:
  Po 12:
     type: dynamic
     min_links: 2
     max_bundle_size: 2
     lacp_system_priority: 2
     channel_members:
       - port: ethernet 1/1/31
         mode: "active"
         port_priority: 3
         lacp_rate_fast: true 
     state: present
################################}
{% if os10_lag is defined and os10_lag %}
{% for key  in os10_lag.keys() %}
{% set channel_id = key.split(" ") %}
{% set lag_vars = os10_lag[key] %}

  {% if lag_vars.lacp_system_priority is defined %}
    {% if lag_vars.lacp_system_priority %}
lacp system-priority {{ lag_vars.lacp_system_priority }}
    {% else %}
no lacp system-priority
    {% endif %}
  {% endif %}

  {% if lag_vars.state is defined and lag_vars.state == "absent" %}
no interface port-channel {{ channel_id[1] }}
  {% else %}
interface port-channel{{ channel_id[1] }}
    {% if lag_vars.min_links is defined %}
      {% if lag_vars.min_links %}
 minimum-links {{ lag_vars.min_links }}
      {% else %}
 no minimum-links
      {% endif %}
    {% endif %}
    {% if lag_vars.max_bundle_size is defined %}
      {% if lag_vars.max_bundle_size %}
 lacp max-bundle {{ lag_vars.max_bundle_size }}
      {% else %}
 no lacp max-bundle
      {% endif %}
    {% endif %}
    {% if lag_vars.lacp_fallback_enable is defined and lag_vars.lacp_fallback_enable %}
 lacp fallback enable
    {% endif %}
    {% if lag_vars.channel_members is defined %}
      {% for ports in lag_vars.channel_members %}
        {% if ports.port is defined and ports.port %}
interface {{ ports.port }}
          {% if lag_vars.type is defined and lag_vars.type == "static" %}
            {% if ports.mode is defined and ports.mode == "on" %}
 channel-group {{ channel_id[1] }} mode on
            {% else %}
 no channel-group
            {% endif %}
          {% elif lag_vars.type is defined and lag_vars.type == "dynamic" %}
            {% if ports.mode is defined and ports.mode == "active" or ports.mode == "passive" %}
 channel-group {{ channel_id[1] }} mode {{ ports.mode }}
            {% else %}
 no channel-group
            {% endif %}
          {% endif %}
          {% if ports.lacp_rate_fast is defined %}
            {% if ports.lacp_rate_fast %}
 lacp rate fast 
            {% else %}
 no lacp rate fast
            {% endif %}
          {% endif %}
          {% if ports.port_priority is defined %}
            {% if ports.port_priority %}
 lacp port-priority {{ ports.port_priority }}
            {% else %}
 no lacp port-priority
            {% endif %}
          {% endif %}
        {% endif %}
      {% endfor %}
    {% endif %}
 
  {% endif %}
{% endfor %}
{% endif %}