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
This commit is contained in:
Lance Albertson 2020-02-05 14:31:37 -08:00
parent ceccaadf8a
commit 118d5e8983
15 changed files with 48 additions and 86 deletions

View File

@ -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

View File

@ -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

View File

@ -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, 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

View File

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

View File

@ -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");

View File

@ -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'

View File

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

View File

@ -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

View File

@ -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");

View File

@ -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'

View File

@ -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

View File

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

View File

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

View File

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

View File

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