diff --git a/README.md b/README.md index b5f0b14..e0ef9e0 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ If the value of the "bind_interface" attribute is non-nil, then the database ser See the attributes mysql.rb file for the mysql specific attributes that are available. -For more information see: http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html +For more information see: http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html Testing ===== diff --git a/attributes/mysql.rb b/attributes/mysql.rb index 0c84a4a..29f8154 100644 --- a/attributes/mysql.rb +++ b/attributes/mysql.rb @@ -16,15 +16,15 @@ # limitations under the License. # -# MySql attributes that we use the mysql cookbook defaults: +# MySQL attributes that we use the mysql cookbook defaults: # Data directory default['openstack']['mysql']['data_dir'] = nil -# MySql attributes that we select defaults for: +# MySQL attributes that we select defaults for: -# Version, support 5.5 and above -default['openstack']['mysql']['version'] = '5.5' +# Version, support 5.7 and above +default['openstack']['mysql']['version'] = '5.7' # Service name default['openstack']['mysql']['service_name'] = 'default' # Storage engine, base OpenStack requires the InnoDB flavor diff --git a/metadata.rb b/metadata.rb index 88de156..2272704 100755 --- a/metadata.rb +++ b/metadata.rb @@ -23,8 +23,8 @@ end depends 'mariadb', '~> 0.3.1' depends 'percona', '~> 0.16.1' -depends 'mysql', '~> 7.2.0' +depends 'mysql', '~> 8.0' depends 'mysql2_chef_gem', '~> 1.1.0' depends 'postgresql', '~> 3.4.18' -depends 'database', '~> 4.0.2' +depends 'database', '~> 6.0' depends 'openstack-common', '>= 14.0.0' diff --git a/recipes/mariadb-client.rb b/recipes/mariadb-client.rb index bc3fda1..77ad1dd 100644 --- a/recipes/mariadb-client.rb +++ b/recipes/mariadb-client.rb @@ -21,6 +21,7 @@ include_recipe 'mariadb::client' mysql2_chef_gem 'default' do provider Chef::Provider::Mysql2ChefGem::Mariadb + gem_version '0.4.4' action :install end diff --git a/recipes/mysql-client.rb b/recipes/mysql-client.rb index 5763d81..dbfb864 100644 --- a/recipes/mysql-client.rb +++ b/recipes/mysql-client.rb @@ -21,10 +21,20 @@ # mysql_client 'default' do + version node['openstack']['mysql']['version'] action :create end +# install the mysql development headers +case node['platform_family'] +when 'debian' + package 'libmysqlclient-dev' +when 'rhel' + package 'mariadb-devel' +end + mysql2_chef_gem 'default' do + gem_version '0.4.4' action :install end diff --git a/spec/mariadb-server-redhat_spec.rb b/spec/mariadb-server-redhat_spec.rb index caf57c1..8a6617d 100644 --- a/spec/mariadb-server-redhat_spec.rb +++ b/spec/mariadb-server-redhat_spec.rb @@ -11,7 +11,7 @@ describe 'openstack-ops-database::mariadb-server' do let(:file) { chef_run.template('/etc/my.cnf.d/openstack.cnf') } it 'creates template /etc/my.cnf.d/openstack.cnf' do - node.set['mariadb']['install']['version'] = '5.5' + node.set['mariadb']['install']['version'] = '5.7' expect(chef_run).to create_template(file.name).with( user: 'mysql', group: 'mysql', diff --git a/spec/mariadb-server_spec.rb b/spec/mariadb-server_spec.rb index 7aaaded..1d1aaec 100644 --- a/spec/mariadb-server_spec.rb +++ b/spec/mariadb-server_spec.rb @@ -23,7 +23,7 @@ describe 'openstack-ops-database::mariadb-server' do end it 'creates template /etc/mysql/conf.d/openstack.cnf' do - node.set['mariadb']['install']['version'] = '5.5' + node.set['mariadb']['install']['version'] = '5.7' expect(chef_run).to create_template(file.name).with( user: 'mysql', group: 'mysql', diff --git a/spec/mysql-client_spec.rb b/spec/mysql-client_spec.rb index 86bc0d9..d185d42 100644 --- a/spec/mysql-client_spec.rb +++ b/spec/mysql-client_spec.rb @@ -19,6 +19,7 @@ describe 'openstack-ops-database::mysql-client' do it 'installs mysql packages' do expect(chef_run).to install_package 'python-mysqldb' + expect(chef_run).to install_package 'libmysqlclient-dev' end end end diff --git a/spec/mysql-server_spec.rb b/spec/mysql-server_spec.rb index 4c7a7e7..64218cc 100644 --- a/spec/mysql-server_spec.rb +++ b/spec/mysql-server_spec.rb @@ -15,8 +15,8 @@ describe 'openstack-ops-database::mysql-server' do it 'creates mysql default service' do expect(chef_run).to create_mysql_service('default').with( - version: '5.5', - data_dir: nil, + version: '5.7', + data_dir: '/var/lib/mysql-default', initial_root_password: 'abc123', bind_address: '127.0.0.1', port: '3306', diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f2b1554..20b2de6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,7 +12,7 @@ REDHAT_OPTS = { }.freeze UBUNTU_OPTS = { platform: 'ubuntu', - version: '14.04', + version: '16.04', log_level: ::LOG_LEVEL }.freeze