From 93e7380abfa1acbb90c0f654909bdaae4f14429e 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 - Update delivery configuration to exclude integration cookbooks Depends-On: https://review.opendev.org/701027 Depends-On: https://review.opendev.org/706101 Change-Id: Ib2ccf949d5f5bced0f6efd32b09780469316b831 --- .delivery/project.toml | 10 +++++++++- .rubocop.yml | 19 ------------------- .rubocop_todo.yml | 13 ------------- README.rst | 10 +++++++--- attributes/default.rb | 4 ++-- attributes/mysql.rb | 2 +- metadata.rb | 16 +++------------- recipes/client.rb | 6 +++--- recipes/mariadb-client.rb | 2 +- recipes/mariadb-cluster-client.rb | 2 +- recipes/mariadb-cluster-server.rb | 16 ++++++++-------- recipes/mariadb-server.rb | 2 +- recipes/mysql-client.rb | 8 ++++---- recipes/mysql-server.rb | 8 ++++---- recipes/openstack-db.rb | 4 ++-- recipes/server.rb | 6 +++--- 16 files changed, 49 insertions(+), 79 deletions(-) delete mode 100644 .rubocop_todo.yml diff --git a/.delivery/project.toml b/.delivery/project.toml index 6d5e361..4066e55 100644 --- a/.delivery/project.toml +++ b/.delivery/project.toml @@ -1 +1,9 @@ -remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml" +[local_phases] +unit = 'rspec spec/' +lint = 'cookstyle --display-cop-names --extra-details' +syntax = "berks install -e integration" +provision = "echo skipping" +deploy = "echo skipping" +smoke = "echo skipping" +functional = "echo skipping" +cleanup = "echo skipping" 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..ded4ad0 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.18 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 080d0b0..e44d65c 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 b735f42..87b4ac3 100755 --- a/metadata.rb +++ b/metadata.rb @@ -3,27 +3,17 @@ 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', '~> 3.1' depends 'mysql', '~> 8.6' issues_url 'https://launchpad.net/openstack-chef' source_url 'https://opendev.org/openstack/cookbook-openstack-ops-database' -chef_version '>= 14.0' +chef_version '>= 15.0' 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 6bacf61..ab12750 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"); 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 d18e9c3..a6de1da 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"); diff --git a/recipes/mysql-client.rb b/recipes/mysql-client.rb index 6e4fd62..8d3176e 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 3918e1e..783db55 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.