From ec77bbc38b7c8fa46ffc1c6939475fd655654ac2 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Tue, 15 Dec 2015 15:36:17 -0800 Subject: [PATCH] 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 --- manifests/init.pp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 7e19a5c..7084c71 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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', + } + }, } }