puppet-percona icon indicating copy to clipboard operation
puppet-percona copied to clipboard

Documentation unclear with regards to hiera and using hashes

Open tdm4 opened this issue 12 years ago • 4 comments

Readme.MD says for client & server:

Client and server

    class { 'apt': }
    class { 'percona': server => true, }

    Class['apt'] ->
    Class['percona']

However further down it says you can import the data from hiera by using this in manifests:

  class {'percona::params':
    default_configuration => hiera('percona_config_global', undef),
  }

include percona

Makes sense so far.. so I try to put this in my manifests:

  class { 'apt' : }

  class {'percona::params':
    default_configuration => hiera('percona_config_global', undef),
  }

  include percona

  Class['apt'] ->
  Class['percona']

I get an error when trying to add user database rights:

Error: Failed to apply catalog: Could not find dependency Service[mysql] for Mysql_user[testuser@localhost at /etc/puppet/modules/percona/manifests/rights.pp:142

What is the correct way to include these in the manifests? I tried declaring class { 'percona' } first and got redeclaration errors.

Is it possible to embed the 'percona_version', 'server' and 'manage_repo' variables into hiera as well?

Thanks!

tdm4 avatar Jan 09 '14 13:01 tdm4

Never mind, I figured it out. Manifest should look as follows:

  class { 'apt' : }

  class {'percona::params':
    percona_version       => '5.5',
    server                => true,
    manage_repo           => true,
    default_configuration => hiera('percona_config_global', undef),
  } 

  include percona

  Class['apt'] ->
  Class['percona']

tdm4 avatar Jan 09 '14 13:01 tdm4

Actually, the confusion seems to be caused due to the fact that on Ubuntu/Debian hosts, this default_configuration is not used. In the my.cnf.Debian.erb there is no reference to the hash, but there is in my.cnf.erb.

Is this by design?

tdm4 avatar Jan 09 '14 15:01 tdm4

@tdm4, I initially only had time to test on a centos machine. I'll try and fix this soonish.

vStone avatar Jun 11 '14 11:06 vStone

Did you find the time to fix this @vStone? I'm unable to test myself at this point in time.

arioch avatar Sep 01 '14 13:09 arioch