Hi Sam On 03 Feb 2016, at 16:28, Sam <kailash....@gmail.com> wrote: > My hiera entries - > > mysqlconfig::custom_mysql_options: > mysqld: > replicate-ignore-db: 'test' > server-id: 12 > datadir: '/data/mysql_data' > > > I want to get the value of datadir in my puppet module. Please let me know > what is the syntax I need to use to fetch this value. I tried something as > follows but it doesn't work. > > > $datadir = hiera('mysqlconfig::custom_mysql_options[datadir]’)
With hiera you can only specify keys, not elements of a hash. you should change this to: $custom_mysql_options = hiera(‘mysqlconfig::custom_mysql_options’) You can now set a new variable reading the hash element: $datadir = $custom_mysql_options[‘datadir’] > > file { "$datadir": > ensure => directory, > owner => 'mysql', > group => 'mysql', > mode => '0755', > } > > hth, Martin > Thanks in advance > Sam > > -- > 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 puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/95efaffa-4873-4fda-9caa-3a38e7b3c1de%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7687C384-3106-4A61-AC14-1F90BB21CB33%40gmail.com. For more options, visit https://groups.google.com/d/optout.