Commit 1b04dd2b authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Broke out into own module

parents
class ipoib {
$packages = $facts['os']['family'] ? {
'RedHat' => ['infiniband-diags', 'libibverbs'],
'Debian' => ['infiniband-diags', 'ibverbs-utils', 'ibverbs-providers', 'libibverbs1', 'librdmacm1'],
}
package { $packages:
ensure => installed,
}
-> file { '/etc/modules-load.d/ipoib.conf':
content =>
"
mlx4_ib
rdma_ucm
ib_umad
ib_uverbs
ib_ipoib",
}
exec { '/usr/bin/systemctl restart systemd-modules-load':
subscribe => File['/etc/modules-load.d/ipoib.conf'],
refreshonly => true,
}
}
define ipoib::interface(
$interface = $name,
$mtu = '65520',
$connected_mode = 'yes',
$ipaddress = undef,
$netmask = '255.255.255.0',
$gateway = undef,
$domain = undef,
$dns1 = undef,
$dns2 = undef,
$arp_ignore = '1',
) {
require ::ipoib
if $ipaddress == undef {
fail('ipoib::interface requires an ip address')
}
sysctl { "net.ipv4.conf.${interface}.arp_ignore":
ensure => present,
value => $arp_ignore,
}
-> network::interface { $interface:
ipaddress => $ipaddress,
netmask => $netmask,
gateway => $gateway,
type => 'InfiniBand',
domain => $domain,
dns1 => $dns1,
dns2 => $dns2,
options_extra_redhat => {
'CONNECTED_MODE' => $connected_mode,
},
mtu => $mtu,
# Pre up for debian
pre_up => [
'modprobe ib_umad',
'modprobe mlx4_ib',
'modprobe ib_ipoib',
'echo connected > /sys/class/net/ibo3/mode',
],
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment