doubt in define key

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

Chutki gravatar image

Hi,

I got below maifests from puppet wiki

class sysctl {
$sys_test = hiera_hash('sysctl_file2::systest')
create_resources('sysctltest::sample_def',$sys_test)
}

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

sysctl_file2::systest
  kernel.shmmax:
    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

Comments

any explanation on this.

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