aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystem/sysctl/entry.pp
blob: 93230d5ca615bd00c6ec403353b31b0c44a942ae (plain)
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
# Simple sysctl definition
define nodo::subsystem::sysctl::entry(
  $ensure = present,
  $order  = '',
  $value
) {
  if $order != '' {
    $prefix = "${order}-"
  }
  else {
    $prefix = ''
  }

  file { "/etc/sysctl.d/${prefix}${name}.conf":
    owner   => "root",
    group   => "root",
    mode    => 0644,
    ensure  => $ensure,
    content => "$name = $value\n",
  }

  exec { "sysctl ${name}=${value}":
    user        => root,
    subscribe   => File["/etc/sysctl.d/${prefix}${name}.conf"],
    refreshonly => true,
  }
}