doubt in define key

asked 2015-02-10 11:54:57 -0500

Chutki gravatar image


I got below maifests from puppet wiki

class sysctl {
$sys_test = hiera_hash('sysctl_file2::systest')

define sysctltest::sample_def( $value ) {
  $key = $title
  $context = "/files/etc/sysctl.conf"
   augeas { "sysctl_conf/$key":
     context => "$context",
     onlyif  => "get $key < '$value'",
     changes => "set $key '$value'",

below is my yaml file

    valu: 1234

my requirement is want change shmmax value, if value is less than the given. The manifests is working perfectly.

assigning title to key variable (kernel.shmmax from yaml file ) "$key = $title", but how they set value varible to key in augeas resource. Because my understanding is $key is ( kernel.shmmax) and $value is (1234), how numeric replace string. Bit confusing

edit retag flag offensive close merge delete


any explanation on this.

Chutki gravatar imageChutki ( 2015-02-12 06:15:38 -0500 )edit