Incremented MySQL to 5.7 for Ubuntu

- mysql default version is 5.7 on Ubuntu 16.04
- included mysql devel headers for mysql2
- incremented mysql cookbook to 8.0
- incremented database cookbook to 6.0
- pinned mysql2 gem at 0.4.4

Depends-On: I57c8729e8732161ac34caa85259de8264e99c56d
Implements blueprint newton-xenial

Change-Id: I8ee882d5b154ec0d319e6c4186ebf9f8ae68f269
This commit is contained in:
Samuel Cassiba 2016-10-18 09:52:02 -07:00
parent 6cdfe56ea2
commit eb3c4081f1
10 changed files with 24 additions and 12 deletions

View File

@ -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. 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 Testing
===== =====

View File

@ -16,15 +16,15 @@
# limitations under the License. # limitations under the License.
# #
# MySql attributes that we use the mysql cookbook defaults: # MySQL attributes that we use the mysql cookbook defaults:
# Data directory # Data directory
default['openstack']['mysql']['data_dir'] = nil 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 # Version, support 5.7 and above
default['openstack']['mysql']['version'] = '5.5' default['openstack']['mysql']['version'] = '5.7'
# Service name # Service name
default['openstack']['mysql']['service_name'] = 'default' default['openstack']['mysql']['service_name'] = 'default'
# Storage engine, base OpenStack requires the InnoDB flavor # Storage engine, base OpenStack requires the InnoDB flavor

View File

@ -23,8 +23,8 @@ end
depends 'mariadb', '~> 0.3.1' depends 'mariadb', '~> 0.3.1'
depends 'percona', '~> 0.16.1' depends 'percona', '~> 0.16.1'
depends 'mysql', '~> 7.2.0' depends 'mysql', '~> 8.0'
depends 'mysql2_chef_gem', '~> 1.1.0' depends 'mysql2_chef_gem', '~> 1.1.0'
depends 'postgresql', '~> 3.4.18' depends 'postgresql', '~> 3.4.18'
depends 'database', '~> 4.0.2' depends 'database', '~> 6.0'
depends 'openstack-common', '>= 14.0.0' depends 'openstack-common', '>= 14.0.0'

View File

@ -21,6 +21,7 @@ include_recipe 'mariadb::client'
mysql2_chef_gem 'default' do mysql2_chef_gem 'default' do
provider Chef::Provider::Mysql2ChefGem::Mariadb provider Chef::Provider::Mysql2ChefGem::Mariadb
gem_version '0.4.4'
action :install action :install
end end

View File

@ -21,10 +21,20 @@
# #
mysql_client 'default' do mysql_client 'default' do
version node['openstack']['mysql']['version']
action :create action :create
end 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 mysql2_chef_gem 'default' do
gem_version '0.4.4'
action :install action :install
end end

View File

@ -11,7 +11,7 @@ describe 'openstack-ops-database::mariadb-server' do
let(:file) { chef_run.template('/etc/my.cnf.d/openstack.cnf') } let(:file) { chef_run.template('/etc/my.cnf.d/openstack.cnf') }
it 'creates template /etc/my.cnf.d/openstack.cnf' do 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( expect(chef_run).to create_template(file.name).with(
user: 'mysql', user: 'mysql',
group: 'mysql', group: 'mysql',

View File

@ -23,7 +23,7 @@ describe 'openstack-ops-database::mariadb-server' do
end end
it 'creates template /etc/mysql/conf.d/openstack.cnf' do 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( expect(chef_run).to create_template(file.name).with(
user: 'mysql', user: 'mysql',
group: 'mysql', group: 'mysql',

View File

@ -19,6 +19,7 @@ describe 'openstack-ops-database::mysql-client' do
it 'installs mysql packages' do it 'installs mysql packages' do
expect(chef_run).to install_package 'python-mysqldb' expect(chef_run).to install_package 'python-mysqldb'
expect(chef_run).to install_package 'libmysqlclient-dev'
end end
end end
end end

View File

@ -15,8 +15,8 @@ describe 'openstack-ops-database::mysql-server' do
it 'creates mysql default service' do it 'creates mysql default service' do
expect(chef_run).to create_mysql_service('default').with( expect(chef_run).to create_mysql_service('default').with(
version: '5.5', version: '5.7',
data_dir: nil, data_dir: '/var/lib/mysql-default',
initial_root_password: 'abc123', initial_root_password: 'abc123',
bind_address: '127.0.0.1', bind_address: '127.0.0.1',
port: '3306', port: '3306',

View File

@ -12,7 +12,7 @@ REDHAT_OPTS = {
}.freeze }.freeze
UBUNTU_OPTS = { UBUNTU_OPTS = {
platform: 'ubuntu', platform: 'ubuntu',
version: '14.04', version: '16.04',
log_level: ::LOG_LEVEL log_level: ::LOG_LEVEL
}.freeze }.freeze