summaryrefslogtreecommitdiff
path: root/manifests/config.pp
blob: 79ddd295b6af61cd4bfddd0a88e4ad951a35cc53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
define sysctl::config ($value, $comment) {

  include sysctl

  augeas { "sysctl_${name}":
    context => '/files/etc/sysctl.conf',
    changes => [ "set ${name} ${value}", "insert #comment before ${name}",
                 "set #comment[last()] '${comment}'" ],
    onlyif  => "get ${name} != ${value}",
    notify  => Exec["sysctl_${name}"],
  }

  exec { "sysctl_${name}":
    command     => '/sbin/sysctl -p',
    subscribe   => File['/etc/sysctl.conf'],
    refreshonly => true,
  }
}