Skip to content

Commit

Permalink
Added support for 100G fanout for OS9
Browse files Browse the repository at this point in the history
  • Loading branch information
abirami-n authored and skg-net committed Jun 20, 2018
1 parent 98cec2d commit e1d3e93
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 111 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ Role variables
| ``switchport`` | boolean: true,false\* | Configures an interface in L2 mode | dellos9, dellos10 |
| ``admin`` | string: up,down\* | Configures the administrative state for the interface; configuring the value as administratively "up" enables the interface; configuring the value as administratively "down" disables the interface | dellos6, dellos9, dellos10 |
| ``mtu`` | integer | Configures the MTU size for L2 and L3 interfaces; example, MTU range is 594 to 12000 for dellos9 devices, 1280 to 65535 on dellos10 devices, and set globally on dellos6 devices | dellos9, dellos10 |
| ``fanout`` | string in dellos10, boolean: true,false in dellos9 | Configures fanout on the port if set to true in dellos9 devices and to the appropriate value (10g-4x/ 40g-1x/ 25g-4x/ 100g-1x/ 50g-2x) in dellos10 devices.| dellos9, dellos10 |
| ``keepalive`` | boolean: true,false | Configures keepalive on the port if set to true | dellos9 |
| ``fanout`` | string:dual, single, quad (dellos9); string:10g-4x, 40g-1x, 25g-4x, 100g-1x, 50g-2x (dellos10) | Configures fanout to the appropriate value in dellos* devices.| dellos9, dellos10 |
| ``fanout_speed`` | string: 10G, 25G, 40G, 50G | Configures speed for the fanout port based on the fanout mode specified | dellos9 |
| ``fanout_state`` | string: present, absent* | Configures the fanout mode to a port if state is set to present | dellos9 |
| ``keepalive`` | boolean: true,false | Configures keepalive on the port if set to true | dellos9 |
| ``speed`` | string:10,100,1000,auto | Configures interface speed parameters | dellos9 |
| ``duplex`` | string: full,half | Configures interface duplex parameters | dellos9 |
| ``auto_neg`` | boolean: true,false | Configures auto-negotiation mode if set to true | dellos9 |
Expand Down
224 changes: 117 additions & 107 deletions templates/dellos9_interface.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,203 +26,213 @@ dellos_interface:
class_vendor_identifier: present
option82: true
remote_id: hostname
fanout: True
speed: auto
duplex: half
fortyGigE 1/1:
fanout: single
fanout_speed: 40G
fanout_state: present
fortyGigE 0/8:
cr4_auto_neg: true
####################################################}
{% if dellos_interface is defined and dellos_interface %}
{% for key in dellos_interface.keys() %}
{% set intf_vars = dellos_interface[key] %}
{% set intf = key.split(" ") %}
{% set port = intf[1].split('/') %}
{% if intf_vars.fanout is defined %}
{% if intf_vars.fanout %}
{% if intf_vars.fanout_state is defined and intf_vars.fanout_state == "present" %}
{% if intf_vars.fanout_speed is defined and intf_vars.fanout_speed %}
stack-unit {{ port[0] }} port {{ port[1] }} portmode {{ intf_vars.fanout}} speed {{ intf_vars.fanout_speed }} no-confirm
{% endif %}
{% else %}
no stack-unit {{ port[0] }} port {{ port[1] }} portmode {{ intf_vars.fanout }} no-confirm
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% for key in dellos_interface.keys() %}
{% set intf_vars = dellos_interface[key] %}

{% set intf = key.split(" ") %}
{% set port = intf[1].split('/') %}
{% if intf_vars.fanout is defined %}
{% if intf_vars.fanout %}
stack-unit {{ port[0] }} port {{ port[1] }} portmode quad
{% else %}
no stack-unit {{ port[0] }} port {{ port[1] }} portmode quad
{% endif %}
{% endif %}

{% if (intf_vars.fanout is defined and not intf_vars.fanout) or (intf_vars.fanout is not defined)%}
{% if (intf_vars.fanout is defined and not intf_vars.fanout) or (intf_vars.fanout is not defined)%}
interface {{ key }}
{% if intf_vars.desc is defined %}
{% if intf_vars.desc %}
{% if intf_vars.desc is defined %}
{% if intf_vars.desc %}
description {{ intf_vars.desc }}
{% else %}
{% else %}
no description
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.portmode is defined %}
{% if intf_vars.switchport is defined and intf_vars.switchport == False %}
{% if intf_vars.portmode is defined %}
{% if intf_vars.switchport is defined and intf_vars.switchport == False %}
no switchport
{% endif %}
{% if intf_vars.portmode %}
{% endif %}
{% if intf_vars.portmode %}
portmode {{ intf_vars.portmode}}
{% else %}
{% else %}
no portmode hybrid
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.switchport is defined %}
{% if intf_vars.switchport == True %}
{% if intf_vars.switchport is defined %}
{% if intf_vars.switchport == True %}
switchport
{% endif %}
{% if intf_vars.portmode is not defined %}
{% if intf_vars.switchport is defined and intf_vars.switchport == False %}
{% endif %}
{% if intf_vars.portmode is not defined %}
{% if intf_vars.switchport is defined and intf_vars.switchport == False %}
no switchport
{% endif %}
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.mtu is defined %}
{% if intf_vars.mtu %}
{% if intf_vars.mtu is defined %}
{% if intf_vars.mtu %}
mtu {{ intf_vars.mtu }}
{% else %}
{% else %}
no mtu
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.keepalive is defined %}
{% if intf_vars.keepalive %}
{% if intf_vars.keepalive is defined %}
{% if intf_vars.keepalive %}
keepalive
{% else %}
{% else %}
no keepalive
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.speed is defined %}
{% if intf_vars.speed %}
{% if intf_vars.speed is defined %}
{% if intf_vars.speed %}
speed {{ intf_vars.speed }}
{% else %}
{% else %}
no speed
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.duplex is defined %}
{% if intf_vars.duplex %}
{% if intf_vars.duplex is defined %}
{% if intf_vars.duplex %}
duplex {{ intf_vars.duplex }}
{% else %}
{% else %}
no duplex
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.auto_neg is defined %}
{% if intf_vars.auto_neg %}
{% if intf_vars.auto_neg is defined %}
{% if intf_vars.auto_neg %}
negotiation auto
{% else %}
{% else %}
no negotiation auto
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.cr4_auto_neg is defined %}
{% if intf_vars.cr4_auto_neg %}
{% if intf_vars.cr4_auto_neg is defined %}
{% if intf_vars.cr4_auto_neg %}
intf-type cr4 autoneg
{% else %}
{% else %}
no intf-type cr4 autoneg
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.suppress_ra is defined %}
{% if intf_vars.suppress_ra == "present" %}
{% if intf_vars.suppress_ra is defined %}
{% if intf_vars.suppress_ra == "present" %}
ipv6 nd suppress-ra
{% else %}
{% else %}
no ipv6 nd suppress-ra
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.ip_type_dynamic is defined and intf_vars.ip_type_dynamic %}
{% if intf_vars.class_vendor_identifier is defined and intf_vars.class_vendor_identifier == "present" %}
{% if intf_vars.option82 is defined and intf_vars.option82 %}
{% if intf_vars.remote_id is defined and intf_vars.remote_id %}
{% if intf_vars.ip_type_dynamic is defined and intf_vars.ip_type_dynamic %}
{% if intf_vars.class_vendor_identifier is defined and intf_vars.class_vendor_identifier == "present" %}
{% if intf_vars.option82 is defined and intf_vars.option82 %}
{% if intf_vars.remote_id is defined and intf_vars.remote_id %}
ip address dhcp vendor-class-identifier relay information-option remote-id {{ intf_vars.remote_id }}
{% else %}
{% else %}
ip address dhcp relay information-option vendor-class-identifier
{% endif %}
{% else %}
{% endif %}
{% else %}
ip address dhcp vendor-class-identifier
{% endif %}
{% endif %}

{% elif intf_vars.class_vendor_identifier is defined and (intf_vars.class_vendor_identifier|length >1 and not intf_vars.class_vendor_identifier == "absent") %}
{% if intf_vars.option82 is defined and intf_vars.option82 %}
{% if intf_vars.remote_id is defined and intf_vars.remote_id %}
{% elif intf_vars.class_vendor_identifier is defined and (intf_vars.class_vendor_identifier|length >1 and not intf_vars.class_vendor_identifier == "absent") %}
{% if intf_vars.option82 is defined and intf_vars.option82 %}
{% if intf_vars.remote_id is defined and intf_vars.remote_id %}
ip address dhcp relay information-option remote-id {{ intf_vars.remote_id }} vendor-class-identifier {{ intf_vars.class_vendor_identifier }}
{% else %}
{% else %}
ip address dhcp relay information-option vendor-class-identifier {{ intf_vars.class_vendor_identifier }}
{% endif %}
{% else %}
{% endif %}
{% else %}
ip address dhcp vendor-class-identifier {{ intf_vars.class_vendor_identifier }}
{% endif %}
{% endif %}

{% else %}
{% if intf_vars.option82 is defined and intf_vars.option82 %}
{% if intf_vars.remote_id is defined and intf_vars.remote_id %}
{% else %}
{% if intf_vars.option82 is defined and intf_vars.option82 %}
{% if intf_vars.remote_id is defined and intf_vars.remote_id %}
ip address dhcp relay information-option remote-id {{ intf_vars.remote_id }}
{% else %}
{% else %}
ip address dhcp relay information-option
{% endif %}
{% else %}
{% endif %}
{% else %}
ip address dhcp
{% endif %}
{% endif %}
{% endif %}
{% else %}
{% if intf_vars.ip_and_mask is defined %}
{% if intf_vars.ip_and_mask %}
{% else %}
{% if intf_vars.ip_and_mask is defined %}
{% if intf_vars.ip_and_mask %}
ip address {{ intf_vars.ip_and_mask }}
{% else %}
{% else %}
no ip address
{% endif %}
{% endif %}
{% endif %}
{% if intf_vars.ip_and_mask_secondary is defined and intf_vars.ip_and_mask_secondary %}
{% if secondary_ip_state is defined and secondary_ip_state == "absent" %}
{% if intf_vars.ip_and_mask_secondary is defined and intf_vars.ip_and_mask_secondary %}
{% if secondary_ip_state is defined and secondary_ip_state == "absent" %}
no ip address {{ intf_vars.ip_and_mask_secondary }} secondary
{% else %}
{% else %}
ip address {{ intf_vars.ip_and_mask_secondary }} secondary
{% endif %}
{% endif %}
{% endif %}
{% endif %}


{% if intf_vars.ipv6_and_mask is defined %}
{% if intf_vars.ipv6_and_mask %}
{% if intf_vars.ipv6_and_mask is defined %}
{% if intf_vars.ipv6_and_mask %}
ipv6 address {{ intf_vars.ipv6_and_mask }}
{% else %}
{% else %}
no ipv6 address
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.ipv6_reachabletime is defined %}
{% if intf_vars.ipv6_reachabletime %}
{% if intf_vars.ipv6_reachabletime is defined %}
{% if intf_vars.ipv6_reachabletime %}
ipv6 nd reachable-time {{ intf_vars.ipv6_reachabletime }}
{% else %}
{% else %}
no ipv6 nd reachable-time
{% endif %}
{% endif %}
{% endif %}

{% if intf_vars.ip_helper is defined and intf_vars.ip_helper %}
{% for helper in intf_vars.ip_helper %}
{% if helper.ip is defined and helper.ip %}
{% if helper.state is defined and helper.state == "absent" %}
{% if intf_vars.ip_helper is defined and intf_vars.ip_helper %}
{% for helper in intf_vars.ip_helper %}
{% if helper.ip is defined and helper.ip %}
{% if helper.state is defined and helper.state == "absent" %}
no ip helper-address {{ helper.ip }}
{% else %}
{% else %}
ip helper-address {{ helper.ip }}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}

{% if intf_vars.admin is defined %}
{% if intf_vars.admin == "up" %}
{% if intf_vars.admin is defined %}
{% if intf_vars.admin == "up" %}
no shutdown
{% elif intf_vars.admin == "down" %}
{% elif intf_vars.admin == "down" %}
shutdown
{% endif %}
{% endif %}
{% endif %}

{% endif %}
{% endif %}
{% endfor %}
{% endif %}
6 changes: 4 additions & 2 deletions tests/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dellos_interface:
admin: up
ipv6_autoconfig: True
ethernet 1/1/14:
fanout: true
fanout: 10g-4x
ethernet 1/1/13:
desc: "set ipv6 address"
admin: up
Expand Down Expand Up @@ -80,7 +80,9 @@ dellos_interface:
remote_id: hostname
ipv6_and_mask: 2001:4898:5808:ffa2::9/126
fortyGigE 1/12:
fanout: true
fanout: single
fanout_speed: 40G
fanout_state: present
Vlan 100:
mtu: 4096
admin: down
Expand Down

0 comments on commit e1d3e93

Please # to comment.