Compare commits

..

No commits in common. "coryhawkvelt-patch-1" and "master" have entirely different histories.

1 changed files with 152 additions and 106 deletions

View File

@ -1,106 +1,152 @@
auto lo auto lo
iface lo inet loopback iface lo inet loopback
{% if host_loopback_IP is defined %} {% if host_loopback_IP is defined %}
auto lo:1 auto lo:1
iface lo:1 inet static iface lo:1 inet static
address {{host_loopback_IP}}/32 address {{host_loopback_IP}}/32
{% endif %} {% endif %}
{% if OOBNET_NIC is defined %} {% if OOBNET_NIC is defined %}
auto {{OOBNET_NIC}} auto {{OOBNET_NIC}}
allow-hotplug {{OOBNET_NIC}} allow-hotplug {{OOBNET_NIC}}
iface {{OOBNET_NIC}} inet {% if OOBNET_DHCP is defined and OOBNET_DHCP|lower == "true" %}dhcp{% else %}static iface {{OOBNET_NIC}} inet static
address {{OOBNET_IP}}/{{OOBNET_Netmask}} address {{OOBNET_IP}}/{{OOBNET_Netmask}}
{% if OOBNET_GW is defined %}gateway {{OOBNET_GW}}{% endif %} {% if OOBNET_GW is defined %}gateway {{OOBNET_GW}}{% endif %}
{% endif %} {% endif %}
{% endif %}
{% if autobgp_interfaces is defined %}
{% if autobgp_interfaces is defined %} {% for item in autobgp_interfaces %}
{% for item in autobgp_interfaces %}
auto {{ item['name'] }}
auto {{ item['name'] }} allow-hotplug {{ item['name'] }}
allow-hotplug {{ item['name'] }} iface {{ item['name'] }} inet static
iface {{ item['name'] }} inet {% if item['dhcp'] is defined and item['dhcp']|lower == "true" %}dhcp{% else %}static address {{host_loopback_IP}}/32
address {{host_loopback_IP}}/32 {% if item['mtu'] is defined %}
{% endif %} mtu {{ item['mtu'] }}
{% if item['mtu'] is defined %} {% endif %}
mtu {{ item['mtu'] }} {% if item['force10G'] is defined and item['force10G']|lower == "true" %}
{% endif %} #Force speed to 10G
{% if item['force10G'] is defined and item['force10G']|lower == "true" %} post-up sudo ethtool -s {{ item['name'] }} autoneg off
# Force speed to 10G post-up sudo ethtool -s {{ item['name'] }} speed 10000
post-up sudo ethtool -s {{ item['name'] }} autoneg off {% endif %}
post-up sudo ethtool -s {{ item['name'] }} speed 10000 {% if item['force40G'] is defined and item['force40G']|lower == "true" %}
{% endif %} #Force speed to 40G
{% if item['force40G'] is defined and item['force40G']|lower == "true" %} pre-up sudo ethtool -s {{ item['name'] }} autoneg off
# Force speed to 40G pre-up sudo ethtool -s {{ item['name'] }} speed 40000
pre-up sudo ethtool -s {{ item['name'] }} autoneg off {% endif %}
pre-up sudo ethtool -s {{ item['name'] }} speed 40000 {% if item['auto40G'] is defined and item['auto40G']|lower == "true" %}
{% endif %} #Auto speed
{% if item['routes'] is defined %} pre-up sudo /bin/ip link set down {{ item['name'] }} && sleep 1
{% for route in item['routes'] %} pre-up sudo ethtool -s {{ item['name'] }} speed 40000 duplex full autoneg on
up ip route add {{ route['network'] }} via {{ route['gateway'] }} || true post-up sudo /bin/ip link set up {{ item['name'] }}
{% endfor %} {% endif %}
{% endif %} {% if item['routes'] is defined %}
{% endfor %} {% for route in item['routes'] %}
{% endif %} up ip route add {{ route['network'] }} via {{ route['gateway'] }} || true
{% endfor %}
{% if addressed_interfaces is defined and addressed_interfaces != [] %} {% endif %}
{% for item in addressed_interfaces %} {% endfor %}
{% endif %}
auto {{ item['name'] }}
allow-hotplug {{ item['name'] }} {% if addressed_interfaces is defined and addressed_interfaces != [] %}
iface {{ item['name'] }} inet {% if item['dhcp'] is defined and item['dhcp']|lower == "true" %}dhcp{% else %}static {% for item in addressed_interfaces %}
address {{item['ip_address']}}/{{item['ip_netmask']}}
{% endif %} auto {{ item['name'] }}
{% if item['mtu'] is defined %} allow-hotplug {{ item['name'] }}
mtu {{ item['mtu'] }} iface {{ item['name'] }} inet static
{% endif %} address {{item['ip_address']}}/{{item['ip_netmask']}}
{% if item['routes'] is defined %} {% if item['mtu'] is defined %}
{% for route in item['routes'] %} mtu {{ item['mtu'] }}
up ip route add {{ route['network'] }} via {{ route['gateway'] }} || true {% endif %}
{% endfor %} {% if item['ip_gateway'] is defined %}
{% endif %} gateway {{item['ip_gateway']}}
{% endif %}
{% endfor %} {% if item['force10G'] is defined and item['force10G']|lower == "true" %}
{% endif %} post-up sudo ethtool -s {{ item['name'] }} autoneg off
post-up sudo ethtool -s {{ item['name'] }} speed 10000
{% if bond_interfaces is defined and bond_interfaces != [] %} {% endif %}
{% for item in bond_interfaces %} {% if item['routes'] is defined %}
{% for slave in item['slaves'] %} {% for route in item['routes'] %}
auto {{slave['name']}} up ip route add {{ route['network'] }} via {{ route['gateway'] }} || true
iface {{slave['name']}} inet manual {% endfor %}
bond-master {{ item['name'] }} {% endif %}
{% endfor %}
{% endfor %}
auto {{ item['name'] }} {% endif %}
iface {{ item['name'] }} inet {% if item['dhcp'] is defined and item['dhcp']|lower == "true" %}dhcp{% else %}{% if item['ip_address'] is defined %}static
address {{item['ip_address']}}/{{item['ip_netmask']}} {% if bond_interfaces is defined and bond_interfaces != [] %}
{% else %}manual{% endif %}{% endif %} {% for item in bond_interfaces %}
{% if item['routes'] is defined %} {% for slave in item['slaves'] %}
{% for route in item['routes'] %} auto {{slave['name']}}
up ip route add {{ route['network'] }} via {{ route['gateway'] }} || true iface {{slave['name']}} inet manual
{% endfor %} bond-master {{ item['name'] }}
{% endif %} {% endfor %}
{% endfor %}
{% endif %} auto {{ item['name'] }}
{% if item['ip_address'] is defined %}
{% if vlan_interfaces is defined and vlan_interfaces != [] %} iface {{ item['name'] }} inet static
{% for item in vlan_interfaces %} address {{item['ip_address']}}/{{item['ip_netmask']}}
auto {{ item['name'] }} {% else %}
iface {{ item['name'] }} inet {% if item['dhcp'] is defined and item['dhcp']|lower == "true" %}dhcp{% else %}{% if item['ip_address'] is defined %}static iface {{ item['name'] }} inet manual
address {{item['ip_address']}}/{{item['ip_netmask']}} {% endif %}
{% else %}manual{% endif %}{% endif %} {% if item['ip_gateway'] is defined %}
{% if item['routes'] is defined %} gateway {{item['ip_gateway']}}
{% for route in item['routes'] %} {% endif %}
up ip route add {{ route['network'] }} via {{ route['gateway'] }} || true {% if item['mtu'] is defined %}
{% endfor %} mtu {{ item['mtu'] }}
{% endif %} {% endif %}
{% endfor %} {% if item['bond-mode'] is defined %}
{% endif %} bond-mode {{ item['bond-mode'] }}
{% else %}
{% if unused_interfaces is defined and unused_interfaces != [] %} bond-mode active-backup
{% for item in unused_interfaces %} {% endif %}
allow-hotplug {{ item['name'] }} bond-miimon 100
iface {{ item['name'] }} inet manual bond-slaves none
{% endfor %} {% if item['routes'] is defined %}
{% endif %} {% for route in item['routes'] %}
up ip route add {{ route['network'] }} via {{ route['gateway'] }} || true
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% if vlan_interfaces is defined and vlan_interfaces != [] %}
{% for item in vlan_interfaces %}
auto {{ item['name'] }}
{% if item['ip_address'] is defined %}
iface {{ item['name'] }} inet static
address {{item['ip_address']}}/{{item['ip_netmask']}}
{% else %}
iface {{ item['name'] }} inet manual
{% endif %}
{% if item['ip_gateway'] is defined %}
gateway {{item['ip_gateway']}}
{% endif %}
{% if item['mtu'] is defined %}
mtu {{ item['mtu'] }}
{% endif %}
vlan-raw-device {{ item['vlan-raw-device'] }}
{% if item['routes'] is defined %}
{% for route in item['routes'] %}
up ip route add {{ route['network'] }} via {{ route['gateway'] }} || true
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% if unused_interfaces is defined and unused_interfaces != [] %}
{% for item in unused_interfaces %}
allow-hotplug {{ item['name'] }}
iface {{ item['name'] }} inet manual
{% endfor %}
{% endif %}