Add logic to work with old and new mysql module

This patch uses the load_module_metadata function to check whether the
mysql module has a metadata.json file. If it does, we can assume it's
new enough to support the new interface. If not, use the old one.

Change-Id: I3ff754b15eef51c3c86c188647353a4a1d3bfea0
Depends-On: Ia366c0f7f1bfbfa843071e733a5b0a96873a60d8
This commit is contained in:
Colleen Murphy 2015-12-15 15:36:17 -08:00
parent 2a7b369cee
commit ec77bbc38b
1 changed files with 17 additions and 5 deletions

View File

@ -37,11 +37,23 @@ class nodepool (
) {
class { '::mysql::server':
config_hash => {
'root_password' => $mysql_root_password,
'default_engine' => 'InnoDB',
'bind_address' => '127.0.0.1',
$mysql_data = load_module_metadata('mysql', true)
if $mysql_data == {} {
class { '::mysql::server':
config_hash => {
'root_password' => $mysql_root_password,
'default_engine' => 'InnoDB',
'bind_address' => '127.0.0.1',
}
}
} else { # If it has metadata.json, assume it's new enough to use this interface
class { '::mysql::server':
root_password => $mysql_root_password,
override_options => {
'mysqld' => {
'default-storage-engine' => 'InnoDB',
}
},
}
}