/
config.pp
58 lines (52 loc) · 1.28 KB
/
config.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# Configure OVS to use DPDK
#
# === Parameters
#
# [*package_ensure*]
# (Optional) State of the openvswitch package
# Defaults to 'present'.
#
# [*core_list*]
# (required) The list of cores to be used by the DPDK Poll Mode Driver
#
# [*memory_channels*]
# (required) The number of memory channels to use
#
# [*socket_mem*]
# (required) Set the memory to be allocated on each socket
#
class dpdk::config (
$package_ensure = 'present',
$core_list,
$memory_channels,
$socket_mem,
) {
include ::dpdk::params
package { $::dpdk::params::ovs_package_name:
ensure => $package_ensure,
allow_virtual => true,
before => Service['openvswitch'],
}
# Set DPDK_OPTIONS to openvswitch
$options = "DPDK_OPTIONS = \"-l ${core_list} -n ${memory_channels} --socket-mem ${socket_mem}\""
file_line { 'dpdk_options':
path => '/etc/sysconfig/openvswitch',
match => '^DPDK_OPTIONS.*',
line => $options,
require => Package[$::dpdk::params::ovs_package_name],
before => Service['openvswitch']
}
case $::osfamily {
'Redhat': {
service { 'openvswitch':
ensure => true,
enable => true,
name => $::dpdk::params::ovs_service_name,
}
}
default: {
fail( "${::osfamily} not yet supported by puppet-dpdk")
}
}
}