Add support for configuring MTU on network interfaces

This commit is contained in:
stack 2017-03-17 17:12:27 +00:00
parent 873b694c74
commit 6b2f5dd7e2
2 changed files with 14 additions and 0 deletions

View File

@ -71,6 +71,9 @@ def net_vlan(context, name, inventory_hostname=None):
return net_attr(context, name, 'vlan', inventory_hostname)
net_mtu = _make_attr_filter('mtu')
@jinja2.contextfilter
def net_bridge_ports(context, name, inventory_hostname=None):
return net_attr(context, name, 'bridge_ports', inventory_hostname)
@ -88,12 +91,14 @@ def net_interface_obj(context, name, inventory_hostname=None):
netmask = str(netaddr.IPNetwork(cidr).netmask)
gateway = net_gateway(context, name, inventory_hostname)
vlan = net_vlan(context, name, inventory_hostname)
mtu = net_mtu(context, name, inventory_hostname)
interface = {
'device': device,
'address': ip,
'netmask': netmask,
'gateway': gateway,
'vlan': vlan,
'mtu': mtu,
'bootproto': 'static',
'onboot': 'yes',
}
@ -113,6 +118,7 @@ def net_bridge_obj(context, name, inventory_hostname=None):
netmask = str(netaddr.IPNetwork(cidr).netmask)
gateway = net_gateway(context, name, inventory_hostname)
vlan = net_vlan(context, name, inventory_hostname)
mtu = net_mtu(context, name, inventory_hostname)
ports = net_bridge_ports(context, name, inventory_hostname)
interface = {
'device': device,
@ -120,6 +126,7 @@ def net_bridge_obj(context, name, inventory_hostname=None):
'netmask': netmask,
'gateway': gateway,
'vlan': vlan,
'mtu': mtu,
'ports': ports,
'bootproto': 'static',
'onboot': 'yes',
@ -186,6 +193,7 @@ class FilterModule(object):
'net_allocation_pool_start': net_allocation_pool_start,
'net_allocation_pool_end': net_allocation_pool_end,
'net_vlan': net_vlan,
'net_mtu': net_mtu,
'net_interface_obj': net_interface_obj,
'net_bridge_obj': net_bridge_obj,
'net_is_ether': net_is_ether,

View File

@ -38,6 +38,7 @@
# provision_oc_net_allocation_pool_end:
# provision_oc_net_gateway:
# provision_oc_net_vlan:
# provision_oc_net_mtu:
# Workload provisioning network IP information.
# provision_wl_net_cidr:
@ -45,6 +46,7 @@
# provision_wl_net_allocation_pool_end:
# provision_wl_net_gateway:
# provision_wl_net_vlan:
# provision_wl_net_mtu:
# Internal network IP information.
# internal_net_vip_address:
@ -54,6 +56,7 @@
# internal_net_allocation_pool_end:
# internal_net_gateway:
# internal_net_vlan:
# internal_net_mtu:
# External network IP information.
# external_net_vip_address:
@ -63,6 +66,7 @@
# external_net_allocation_pool_end:
# external_net_gateway:
# external_net_vlan:
# external_net_mtu:
# Storage network IP information.
# storage_net_cidr:
@ -70,6 +74,7 @@
# storage_net_allocation_pool_end:
# storage_net_gateway:
# storage_net_vlan:
# storage_net_mtu:
# Storage management network IP information.
# storage_mgmt_net_cidr:
@ -77,6 +82,7 @@
# storage_mgmt_net_allocation_pool_end:
# storage_mgmt_net_gateway:
# storage_mgmt_net_vlan:
# storage_mgmt_net_mtu:
###############################################################################
# Network virtual patch link configuration.