Hi,

Somehow I got it working with the below config,

cat /etc/puppet/manifests/classes/sysctl.pp

========
class sysctl::config {

  Class['sysctl::config'] -> Sysctl::Entry <| |>

  file { '/etc/sysctl.conf':
    ensure => present,
    mode   => '0644',
    owner  => 'root',
    group  => 'root',
  }

}

define sysctl::entry (
  $value = false
) {

  # Parameter validation
  if ! $value {
    fail('sysctl::entry: value parameter must not be empty')
  }

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

  exec { "sysctl_${name}":
    command     => '/sbin/sysctl -p',
    refreshonly => true,
  }

}
============

on site.pp

==========
node test {
sysctl::entry { 'net.ipv4.tcp_syncookies': value => '1' }
sysctl::entry { 'net.ipv4.tcp_syn_retries': value => '3' }
}
==========

But I want to pass the commented lines for each of the sysctl parameters so 
is it possible to achieve with the above way?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to