Brings in Matt's openstack-ops-database work
Just bring in Matt's original work on the ops-database cookbook. Corrects what I think was a typo for the database service role name attribute from openstack::role::database to openstack::database::server_role Brings in Berksfile and Gemfile and stubbed specs to pass gates. Change-Id: Idc02435ff7d3ff4b8a04c2bfc5abbb1e3091cb68
This commit is contained in:
parent
13286cf341
commit
de13327dce
|
@ -0,0 +1,5 @@
|
|||
*.swp
|
||||
*~
|
||||
.bundle
|
||||
.cookbooks/
|
||||
Berksfile.lock
|
|
@ -0,0 +1,4 @@
|
|||
[gerrit]
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=stackforge/cookbook-openstack-ops-database.git
|
|
@ -1,3 +1,4 @@
|
|||
## 2013.1.0
|
||||
## 7.0.0
|
||||
|
||||
* initial release
|
||||
* Initial release intended for Grizzly-based OpenStack releases,
|
||||
for use with Stackforge upstream repositories.
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
source "https://rubygems.org"
|
||||
|
||||
gem "chef", "~> 10.18.2"
|
||||
gem "berkshelf", "~> 1.4.0"
|
||||
gem "chefspec", "~> 1.2.0"
|
||||
gem "foodcritic", "~> 2.1.0"
|
36
README.md
36
README.md
|
@ -15,23 +15,42 @@ Chef 11 with Ruby 1.9.x required.
|
|||
The following cookbooks are dependencies:
|
||||
|
||||
* database
|
||||
* mysql
|
||||
* openssl
|
||||
|
||||
# Resources/Providers #
|
||||
|
||||
None
|
||||
|
||||
# Recipes #
|
||||
|
||||
## default ##
|
||||
|
||||
- configures the database selected by attributes
|
||||
|
||||
# Attributes #
|
||||
|
||||
# Templates #
|
||||
|
||||
None
|
||||
|
||||
# Recipes #
|
||||
|
||||
## client ##
|
||||
|
||||
- database client configuration, selected by attributes
|
||||
|
||||
## server ##
|
||||
|
||||
- database server configuration, selected by attributes
|
||||
|
||||
## mysql-client ##
|
||||
|
||||
- calls mysql::ruby and mysql::client and installs 'mysql_python_packages'
|
||||
|
||||
## mysql-server ##
|
||||
|
||||
- configures the mysql server for OpenStack
|
||||
|
||||
# Attributes #
|
||||
|
||||
* `openstack['database']['server_role']` - which role should other nodes search on to find the database service, defaults to 'os-ops-database'
|
||||
|
||||
* `openstack['database']['service']` - which service to use, defaults to 'mysql'
|
||||
* `openstack['database']['platform']['mysql_python_packages']` - platform-specific mysql python packages to install
|
||||
|
||||
License and Author
|
||||
==================
|
||||
|
||||
|
@ -44,6 +63,7 @@ License and Author
|
|||
| **Author** | William Kelly (<william.kelly@rackspace.com>) |
|
||||
| **Author** | Darren Birkett (<darren.birkett@rackspace.co.uk>) |
|
||||
| **Author** | Evan Callicoat (<evan.callicoat@rackspace.com>) |
|
||||
| **Author** | Matt Thompson (<matt.thompson@rackspace.co.uk>) |
|
||||
| **Author** | Matt Ray (<matt@opscode.com>) |
|
||||
| | |
|
||||
| **Copyright** | Copyright (c) 2012-2013, Rackspace US, Inc. |
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
default['openstack']['database']['server_role'] = 'os-ops-database'
|
||||
|
||||
default['openstack']['database']['service'] = 'mysql'
|
||||
|
||||
# platform defaults
|
||||
case platform
|
||||
when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this
|
||||
default['openstack']['database']['platform']['mysql_python_packages'] = [ 'MySQL-python' ]
|
||||
when 'ubuntu'
|
||||
default['openstack']['database']['platform']['mysql_python_packages'] = [ 'python-mysqldb' ]
|
||||
end
|
|
@ -0,0 +1,16 @@
|
|||
name "openstack-ops-database"
|
||||
maintainer "Opscode, Inc."
|
||||
maintainer_email "matt@opscode.com"
|
||||
license "Apache 2.0"
|
||||
description "Provides the shared database configuration for Chef for OpenStack."
|
||||
version "7.0.0"
|
||||
|
||||
recipe "client", "Installs client CLI package for the database used by the deployment."
|
||||
recipe "server", "Installs and configures server packages for the database used by the deployment."
|
||||
|
||||
%w{ ubuntu }.each do |os|
|
||||
supports os
|
||||
end
|
||||
|
||||
depends "database", ">= 1.3.12"
|
||||
supports "mysql", ">= 3.0.0"
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# Cookbook Name:: openstack-ops-database
|
||||
# Recipe:: client
|
||||
#
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
#
|
||||
# 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 a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include_recipe "openstack-ops-database::#{node['openstack']['database']['service']}-client"
|
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# Cookbook Name:: openstack-ops-database
|
||||
# Recipe:: mysql-client
|
||||
#
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
#
|
||||
# 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 a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include_recipe "mysql::ruby"
|
||||
include_recipe "mysql::client"
|
||||
|
||||
node.default['openstack']['packages']['ops-database::mysql-client'] = node['openstack']['database']['platform']['mysql_python_packages']
|
|
@ -0,0 +1,63 @@
|
|||
#
|
||||
# Cookbook Name:: openstack-ops-database
|
||||
# Recipe:: mysql-server
|
||||
#
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
# Copyright 2012-2013, Rackspace US, Inc.
|
||||
#
|
||||
# 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 a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
# override default attributes in the upstream mysql cookbook
|
||||
node.set["mysql"]["bind_address"] = bind_ip = "0.0.0.0"
|
||||
node.set['mysql']['tunable']['innodb_thread_concurrency'] = "0"
|
||||
node.set['mysql']['tunable']['innodb_commit_concurrency'] = "0"
|
||||
node.set['mysql']['tunable']['innodb_read_io_threads'] = "4"
|
||||
node.set['mysql']['tunable']['innodb_flush_log_at_trx_commit'] = "2"
|
||||
|
||||
include_recipe "openstack-ops-database::mysql-client"
|
||||
include_recipe "mysql::server"
|
||||
|
||||
mysql_connection_info = {:host => "localhost",
|
||||
:username => 'root',
|
||||
:password => node['mysql']['server_root_password']}
|
||||
|
||||
# removing insecure default mysql users
|
||||
mysql_database_user 'drop empty localhost user' do
|
||||
username ''
|
||||
host 'localhost'
|
||||
connection mysql_connection_info
|
||||
action :drop
|
||||
end
|
||||
|
||||
# removing insecure default mysql users
|
||||
mysql_database_user 'drop empty hostname user' do
|
||||
username ''
|
||||
host node.hostname
|
||||
connection mysql_connection_info
|
||||
action :drop
|
||||
end
|
||||
|
||||
# drop the test database
|
||||
mysql_database 'test' do
|
||||
connection mysql_connection_info
|
||||
action :drop
|
||||
end
|
||||
|
||||
# flush the privileges
|
||||
mysql_database "FLUSH privileges" do
|
||||
connection mysql_connection_info
|
||||
sql "FLUSH privileges"
|
||||
action :nothing
|
||||
subscribes :query, "mysql_database[test]"
|
||||
end
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# Cookbook Name:: openstack-ops-database
|
||||
# Recipe:: server
|
||||
#
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
#
|
||||
# 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 a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include_recipe "openstack-ops-database::#{node['openstack']['database']['service']}-server"
|
|
@ -0,0 +1,4 @@
|
|||
require "spec_helper"
|
||||
|
||||
describe "openstack-ops-database::default" do
|
||||
end
|
|
@ -0,0 +1,12 @@
|
|||
require "chefspec"
|
||||
|
||||
::LOG_LEVEL = :fatal
|
||||
::REDHAT_OPTS = {
|
||||
:platform => "redhat",
|
||||
:log_level => ::LOG_LEVEL
|
||||
}
|
||||
::UBUNTU_OPTS = {
|
||||
:platform => "ubuntu",
|
||||
:version => "12.04",
|
||||
:log_level => ::LOG_LEVEL
|
||||
}
|
Loading…
Reference in New Issue