From c08018b8289b17975eae4936acc551fdda8b1e0a Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Wed, 5 Feb 2020 14:31:37 -0800 Subject: [PATCH] Stein fixes - Cookstyle fixes - Update documentation - Add myself as an author and add OSU for Copyright Depends-On: https://review.opendev.org/701027 Depends-On: https://review.opendev.org/706101 Change-Id: Ib2ccf949d5f5bced0f6efd32b09780469316b831 --- .rubocop.yml | 19 ------------------- .rubocop_todo.yml | 13 ------------- README.rst | 10 +++++++--- attributes/default.rb | 4 ++-- attributes/mysql.rb | 2 +- metadata.rb | 14 ++------------ recipes/client.rb | 6 +++--- recipes/mariadb-client.rb | 4 ++-- recipes/mariadb-cluster-client.rb | 2 +- recipes/mariadb-cluster-server.rb | 16 ++++++++-------- recipes/mariadb-server.rb | 18 +++++++++--------- recipes/mysql-client.rb | 8 ++++---- recipes/mysql-server.rb | 8 ++++---- recipes/openstack-db.rb | 4 ++-- recipes/server.rb | 6 +++--- 15 files changed, 48 insertions(+), 86 deletions(-) delete mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 2f2a2f5..8d19f13 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,3 @@ -inherit_from: .rubocop_todo.yml - AllCops: Include: - metadata.rb @@ -14,20 +12,3 @@ AllCops: - .cookbooks/**/* - berks-cookbooks/**/* - .bundle/**/* - -Encoding: - Exclude: - - metadata.rb - - Gemfile - -NumericLiterals: - Enabled: false - -StringLiterals: - Enabled: false - -LineLength: - Enabled: false - -WordArray: - MinSize: 3 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index 01f635a..0000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2018-08-03 05:26:07 -0700 using RuboCop version 0.55.0. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 28 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Metrics/LineLength: - Max: 113 diff --git a/README.rst b/README.rst index 52d85f9..741c2ec 100644 --- a/README.rst +++ b/README.rst @@ -14,8 +14,8 @@ supports MySQL and PostgreSQL. Requirements ============ -- Chef 14 or higher -- ChefDK 3.2.30 for testing (also includes Berkshelf for cookbook +- Chef 15 or higher +- Chef Workstation 0.15.6 for testing (also includes Berkshelf for cookbook dependency resolution) Platforms @@ -33,7 +33,7 @@ The following cookbooks are dependencies: - 'mariadb', '~> 1.5' - 'mysql2_chef_gem' , '~> 2.0' - 'mysql', '~> 8.2' -- 'openstack-common', '~> 18.0.0' +- 'openstack-common', '~> 19.0.0' Usage ===== @@ -184,6 +184,8 @@ License and Author +-----------------+---------------------------------------------------+ | **Author** | Jan Klare (j.klare@x-ion.de) | +-----------------+---------------------------------------------------+ +| **Author** | Lance Albertson (lance@osuosl.org) | ++-----------------+---------------------------------------------------+ +-----------------+---------------------------------------------------+ | **Copyright** | Copyright (c) 2012-2013, Rackspace US, Inc. | @@ -196,6 +198,8 @@ License and Author +-----------------+---------------------------------------------------+ | **Copyright** | Copyright (c) 2014-2015, IBM, Corp. | +-----------------+---------------------------------------------------+ +| **Copyright** | Copyright (c) 2019-2020, Oregon State University | ++-----------------+---------------------------------------------------+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain diff --git a/attributes/default.rb b/attributes/default.rb index 484285b..c4042d6 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,9 +1,9 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: default # -# Copyright 2013, AT&T Services, Inc. +# Copyright:: 2013, AT&T Services, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/attributes/mysql.rb b/attributes/mysql.rb index 29f8154..1108100 100644 --- a/attributes/mysql.rb +++ b/attributes/mysql.rb @@ -1,6 +1,6 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: default # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/metadata.rb b/metadata.rb index a3476cb..9be4c69 100755 --- a/metadata.rb +++ b/metadata.rb @@ -3,23 +3,13 @@ maintainer 'openstack-chef' maintainer_email 'openstack-discuss@lists.openstack.org' license 'Apache-2.0' description 'Provides the shared database configuration for OpenStack' -version '18.0.0' - -recipe 'client', 'Installs client packages for the database used by the deployment.' -recipe 'server', 'Installs and configures server packages for the database used by the deployment.' -recipe 'mysql-client', 'Installs MySQL client packages.' -recipe 'mysql-server', 'Installs and configures MySQL server packages.' -recipe 'mariadb-client', 'Installs MariaDB client packages.' -recipe 'mariadb-server', 'Installs and configures MariaDB server packages.' -recipe 'mariadb-cluster-client', 'Installs MariaDB Cluster client packages.' -recipe 'mariadb-cluster-server', 'Installs and configures MariaDB Cluster server packages.' -recipe 'openstack-db', 'Creates necessary tables, users, and grants for OpenStack.' +version '19.0.0' %w(ubuntu redhat centos).each do |os| supports os end -depends 'openstack-common', '>= 18.0.0' +depends 'openstack-common', '>= 19.0.0' depends 'mariadb', '~> 1.5' depends 'mysql', '~> 8.6' diff --git a/recipes/client.rb b/recipes/client.rb index 985ac90..f2667b5 100644 --- a/recipes/client.rb +++ b/recipes/client.rb @@ -1,10 +1,10 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: client # -# Copyright 2013, Opscode, Inc. -# Copyright 2013, AT&T Services, Inc. +# Copyright:: 2013, Opscode, Inc. +# Copyright:: 2013, AT&T Services, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/mariadb-client.rb b/recipes/mariadb-client.rb index 46779e4..f281457 100644 --- a/recipes/mariadb-client.rb +++ b/recipes/mariadb-client.rb @@ -1,6 +1,6 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: mariadb-client # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,7 +16,7 @@ # limitations under the License. # -node.normal['mariadb']['use_default_repository'] = true +node.default['mariadb']['use_default_repository'] = true include_recipe 'mariadb::client' mysql2_chef_gem_mariadb 'default' do diff --git a/recipes/mariadb-cluster-client.rb b/recipes/mariadb-cluster-client.rb index 232c43e..7c9f052 100644 --- a/recipes/mariadb-cluster-client.rb +++ b/recipes/mariadb-cluster-client.rb @@ -1,6 +1,6 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: mariadb-cluster-client # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/recipes/mariadb-cluster-server.rb b/recipes/mariadb-cluster-server.rb index e8be276..351a15a 100644 --- a/recipes/mariadb-cluster-server.rb +++ b/recipes/mariadb-cluster-server.rb @@ -1,6 +1,6 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: mariadb-cluster-server # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,22 +25,22 @@ end bind_db = node['openstack']['bind_service']['db'] if bind_db['interface'] listen_address = address_for bind_db['interface'] - node.normal['mariadb']['galera']['options']['port'] = bind_db['port'] + node.default['mariadb']['galera']['options']['port'] = bind_db['port'] else listen_address = bind_db['host'] - node.normal['mariadb']['galera']['options']['port'] = node['openstack']['endpoints']['db']['port'] + node.default['mariadb']['galera']['options']['port'] = node['openstack']['endpoints']['db']['port'] end -node.normal['mariadb']['galera']['options']['bind-address'] = listen_address +node.default['mariadb']['galera']['options']['bind-address'] = listen_address ## CLUSTER SPECIFIC CONFIG -node.normal['mariadb']['galera']['cluster_name'] = 'openstack' -node.normal['mariadb']['galera']['wsrep_provider_options']['gmcast.listen_addr'] = "tcp://#{listen_address}:4567" +node.default['mariadb']['galera']['cluster_name'] = 'openstack' +node.default['mariadb']['galera']['wsrep_provider_options']['gmcast.listen_addr'] = "tcp://#{listen_address}:4567" ### find all nodes in the mariadb cluster cluster_nodes = search(:node, 'recipes:"openstack-ops-database\:\:mariadb-cluster-server"').sort # if it's the first node make sure that wsrep_cluster_address is set to nothing to be able to bootstrap. is_first_node = cluster_nodes.empty? || (cluster_nodes.size == 1 && cluster_nodes.first['fqdn'] == node['fqdn']) if is_first_node - node.normal['mariadb']['galera']['gcomm_address'] = 'gcomm://' + node.default['mariadb']['galera']['gcomm_address'] = 'gcomm://' else # otherwise set the correct cluster address with all cluster nodes family = node['openstack']['endpoints']['family'] @@ -50,7 +50,7 @@ else cluster_nodes_addresses << address end cluster_address = cluster_nodes_addresses.join(',') - node.normal['mariadb']['galera']['gcomm_address'] = "gcomm://#{cluster_address}" + node.default['mariadb']['galera']['gcomm_address'] = "gcomm://#{cluster_address}" end include_recipe 'openstack-ops-database::mariadb-client' diff --git a/recipes/mariadb-server.rb b/recipes/mariadb-server.rb index 9fc3dd2..65df3a5 100644 --- a/recipes/mariadb-server.rb +++ b/recipes/mariadb-server.rb @@ -1,6 +1,6 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: mariadb-server # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,23 +30,23 @@ listen_address = if bind_db['interface'] super_password = get_password 'db', node['openstack']['db']['root_user_key'] -node.normal['mariadb']['remove_test_database'] = true -node.normal['mariadb']['allow_root_pass_change'] = true -node.normal['mariadb']['server_root_password'] = super_password -node.normal['mariadb']['mysqld']['bind_address'] = listen_address +node.default['mariadb']['remove_test_database'] = true +node.default['mariadb']['allow_root_pass_change'] = true +node.default['mariadb']['server_root_password'] = super_password +node.default['mariadb']['mysqld']['bind_address'] = listen_address # increase the default from 5 seconds to allow extra time for services to warm up -node.normal['mariadb']['connect_timeout'] = 30 +node.default['mariadb']['connect_timeout'] = 30 unless listen_address == '127.0.0.1' || listen_address == 'localhost' - node.normal['mariadb']['forbid_remote_root'] = false + node.default['mariadb']['forbid_remote_root'] = false end include_recipe 'openstack-ops-database::mariadb-client' # reuse mysql configuration for mariadb -node.normal['mariadb']['mysqld']['default_storage_engine'] = node['openstack']['mysql']['default-storage-engine'] -node.normal['mariadb']['mysqld']['max_connections'] = node['openstack']['mysql']['max_connections'] +node.default['mariadb']['mysqld']['default_storage_engine'] = node['openstack']['mysql']['default-storage-engine'] +node.default['mariadb']['mysqld']['max_connections'] = node['openstack']['mysql']['max_connections'] include_recipe 'mariadb::server' # reuse mysql configuration file for mariadb diff --git a/recipes/mysql-client.rb b/recipes/mysql-client.rb index 4afc307..6ae318c 100644 --- a/recipes/mysql-client.rb +++ b/recipes/mysql-client.rb @@ -1,11 +1,11 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: mysql-client # -# Copyright 2013, Opscode, Inc. -# Copyright 2013, AT&T Services, Inc. -# Copyright 2014, SUSE Linux, GmbH +# Copyright:: 2013, Opscode, Inc. +# Copyright:: 2013, AT&T Services, Inc. +# Copyright:: 2014, SUSE Linux, GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/mysql-server.rb b/recipes/mysql-server.rb index 20df0fb..ef4b001 100644 --- a/recipes/mysql-server.rb +++ b/recipes/mysql-server.rb @@ -1,11 +1,11 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: mysql-server # -# Copyright 2013, Opscode, Inc. -# Copyright 2012-2013, Rackspace US, Inc. -# Copyright 2013, AT&T Services, Inc. +# Copyright:: 2013, Opscode, Inc. +# Copyright:: 2012-2013, Rackspace US, Inc. +# Copyright:: 2013, AT&T Services, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/openstack-db.rb b/recipes/openstack-db.rb index 9bc2897..6db22df 100644 --- a/recipes/openstack-db.rb +++ b/recipes/openstack-db.rb @@ -1,9 +1,9 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: openstack-db # -# Copyright 2012-2013, AT&T Services, Inc. +# Copyright:: 2012-2013, AT&T Services, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/server.rb b/recipes/server.rb index 70cb04f..d8874c8 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -1,10 +1,10 @@ # encoding: UTF-8 # -# Cookbook Name:: openstack-ops-database +# Cookbook:: openstack-ops-database # Recipe:: server # -# Copyright 2013, Opscode, Inc. -# Copyright 2013, AT&T Services, Inc. +# Copyright:: 2013, Opscode, Inc. +# Copyright:: 2013, AT&T Services, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.