Hi Sam
On 03 Feb 2016, at 16:28, Sam <
kaila...@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...@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.