Browse Source

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
Samuel Cassiba 2 years ago
parent
commit
eb3c4081f1

+ 1
- 1
README.md View File

@@ -84,7 +84,7 @@ If the value of the "bind_interface" attribute is non-nil, then the database ser
84 84
 
85 85
 See the attributes mysql.rb file for the mysql specific attributes that are available.
86 86
 
87
-For more information see: http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html
87
+For more information see: http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html
88 88
 
89 89
 Testing
90 90
 =====

+ 4
- 4
attributes/mysql.rb View File

@@ -16,15 +16,15 @@
16 16
 # limitations under the License.
17 17
 #
18 18
 
19
-# MySql attributes that we use the mysql cookbook defaults:
19
+# MySQL attributes that we use the mysql cookbook defaults:
20 20
 
21 21
 # Data directory
22 22
 default['openstack']['mysql']['data_dir'] = nil
23 23
 
24
-# MySql attributes that we select defaults for:
24
+# MySQL attributes that we select defaults for:
25 25
 
26
-# Version, support 5.5 and above
27
-default['openstack']['mysql']['version'] = '5.5'
26
+# Version, support 5.7 and above
27
+default['openstack']['mysql']['version'] = '5.7'
28 28
 # Service name
29 29
 default['openstack']['mysql']['service_name'] = 'default'
30 30
 # Storage engine, base OpenStack requires the InnoDB flavor

+ 2
- 2
metadata.rb View File

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

+ 1
- 0
recipes/mariadb-client.rb View File

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

+ 10
- 0
recipes/mysql-client.rb View File

@@ -21,10 +21,20 @@
21 21
 #
22 22
 
23 23
 mysql_client 'default' do
24
+  version node['openstack']['mysql']['version']
24 25
   action :create
25 26
 end
26 27
 
28
+# install the mysql development headers
29
+case node['platform_family']
30
+when 'debian'
31
+  package 'libmysqlclient-dev'
32
+when 'rhel'
33
+  package 'mariadb-devel'
34
+end
35
+
27 36
 mysql2_chef_gem 'default' do
37
+  gem_version '0.4.4'
28 38
   action :install
29 39
 end
30 40
 

+ 1
- 1
spec/mariadb-server-redhat_spec.rb View File

@@ -11,7 +11,7 @@ describe 'openstack-ops-database::mariadb-server' do
11 11
     let(:file) { chef_run.template('/etc/my.cnf.d/openstack.cnf') }
12 12
 
13 13
     it 'creates template /etc/my.cnf.d/openstack.cnf' do
14
-      node.set['mariadb']['install']['version'] = '5.5'
14
+      node.set['mariadb']['install']['version'] = '5.7'
15 15
       expect(chef_run).to create_template(file.name).with(
16 16
         user: 'mysql',
17 17
         group: 'mysql',

+ 1
- 1
spec/mariadb-server_spec.rb View File

@@ -23,7 +23,7 @@ describe 'openstack-ops-database::mariadb-server' do
23 23
     end
24 24
 
25 25
     it 'creates template /etc/mysql/conf.d/openstack.cnf' do
26
-      node.set['mariadb']['install']['version'] = '5.5'
26
+      node.set['mariadb']['install']['version'] = '5.7'
27 27
       expect(chef_run).to create_template(file.name).with(
28 28
         user: 'mysql',
29 29
         group: 'mysql',

+ 1
- 0
spec/mysql-client_spec.rb View File

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

+ 2
- 2
spec/mysql-server_spec.rb View File

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

+ 1
- 1
spec/spec_helper.rb View File

@@ -12,7 +12,7 @@ REDHAT_OPTS = {
12 12
 }.freeze
13 13
 UBUNTU_OPTS = {
14 14
   platform: 'ubuntu',
15
-  version: '14.04',
15
+  version: '16.04',
16 16
   log_level: ::LOG_LEVEL
17 17
 }.freeze
18 18
 

Loading…
Cancel
Save