diff --git a/site/profile/manifests/ccs/daq_interface.pp b/site/profile/manifests/ccs/daq_interface.pp index b0b0e672d6..925ec374e9 100644 --- a/site/profile/manifests/ccs/daq_interface.pp +++ b/site/profile/manifests/ccs/daq_interface.pp @@ -8,6 +8,7 @@ String $was, Enum['dhcp-client', 'dhcp-server'] $mode, ) { + $interface = 'lsst-daq' $netconf = $mode ? { 'dhcp-client' => { @@ -20,15 +21,14 @@ }, } - network::interface { 'lsst-daq': - defroute => 'no', # this was yes on comcam-fp01 - ethtool_opts => '--set-ring ${DEVICE} rx 4096 tx 4096; --pause ${DEVICE} autoneg off rx on tx on', - hwaddr => $hwaddr, - ipv6init => 'no', - onboot => true, - type => 'Ethernet', - uuid => $uuid, - * => $netconf, + network::interface { $interface: + defroute => 'no', # this was yes on comcam-fp01 + hwaddr => $hwaddr, + ipv6init => false, + onboot => true, + type => 'Ethernet', + uuid => $uuid, + * => $netconf, } network::interface { $was: @@ -37,18 +37,29 @@ # restarting the network service isn't sufficent to rename an existing # interface. The host has to be rebooted. - $daq_int = $facts['networking']['interfaces']['lsst-daq'] - - unless ($daq_int) { - notify { 'lsst-daq network interface is missing': + unless ($facts['networking']['interfaces'][$interface]) { + notify { "${interface} network interface is missing": notify => Reboot['lsst-daq'], } } Class['network'] - ~> reboot { 'lsst-daq': + -> reboot { $interface: apply => finished, - message => 'setup lsst-daq network interface', + message => "setup ${interface} network interface", when => refreshed, } + + # NM apears to ignore ETHTOOL_OPTS and requires a dispatch script to be used + # to set device parameters + $ptitle = regsubst($title, '::', '/', 'G') + $file = '30-ethtool' + + # XXX we need to have a discussion as to wether or not it is appropriate for + # a template to live in a profile. + file { "/etc/NetworkManager/dispatcher.d/${file}": + ensure => file, + content => epp("${ptitle}/${file}", {'interface' => $interface}), + mode => '0755', + } } diff --git a/site/profile/templates/ccs/daq_interface/30-ethtool.epp b/site/profile/templates/ccs/daq_interface/30-ethtool.epp new file mode 100644 index 0000000000..d089866ea5 --- /dev/null +++ b/site/profile/templates/ccs/daq_interface/30-ethtool.epp @@ -0,0 +1,24 @@ +<%- | String $interface | -%> +#!/bin/sh + +# This file is managed by Puppet; changes may be overwritten + +# https://access.redhat.com/solutions/2841131 + +myname=${0##*/} +log() { logger -p user.info -t "${myname}" "$*"; } +IFACE=$1 +ACTION=$2 + +log "IFACE = $1, ACTION = $2" + +DAQ=<%= $interface %> + +if [ "$IFACE" == "$DAQ" ] && [ "$ACTION" == "up" ]; then + log "ethool set-ring ${IFACE} rx 4096 tx 4096" + /sbin/ethtool --set-ring ${IFACE} rx 4096 tx 4096 + log "ethool pause ${IFACE} autoneg off rx on tx on" + /sbin/ethtool --pause ${IFACE} autoneg off rx on tx on +fi + +exit 0