Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added hiera support #149

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions manifests/db.pp
Expand Up @@ -49,11 +49,13 @@
require => Class['mysql::server'],
}

database_user { "${user}@${host}":
ensure => present,
password_hash => mysql_password($password),
provider => 'mysql',
require => Database[$name],
if !defined(Database_user["${user}@${host}"]) {
database_user { "${user}@${host}":
ensure => present,
password_hash => mysql_password($password),
provider => 'mysql',
require => Database[$name],
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a positive change to deal with multiple mysql::db instances with the same users designated. Could you rebase this commit onto master and submit a new PR from a topic branch? Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huuh, I don't understand what I doing. Only this commit is OK?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's what he's saying.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added pull request again.

}

database_grant { "${user}@${host}/${name}":
Expand Down
3 changes: 3 additions & 0 deletions manifests/server.pp
Expand Up @@ -23,6 +23,9 @@
$enabled = true
) inherits mysql::params {

$config_hash['root_password'] = hiera('mysql_root_password', random_password(8))
$config_hash['bind_address'] = hiera('mysql_bind_address', '127.0.0.1')

Class['mysql::server'] -> Class['mysql::config']

$config_class = {}
Expand Down