Documentation unclear with regards to hiera and using hashes
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!
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']
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, I initially only had time to test on a centos machine. I'll try and fix this soonish.
Did you find the time to fix this @vStone? I'm unable to test myself at this point in time.