Chef Cookbook - Support Cookbook for Database
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lance Albertson ceccaadf8a Set Berksfile to use ruby solver 2 years ago
.delivery Add delivery config 3 years ago
attributes Initial ops-database Pike updates 4 years ago
files/default Add receipes for mariadb cluster deployment 4 years ago
recipes Chef 14 stable release updates and fixes 3 years ago
spec Use Ubuntu 18.04 for ChefSpec tests 2 years ago
templates/default Add additional mysql tunables 6 years ago
.gitignore Initial kilo updates 7 years ago
.gitreview OpenDev Migration Patch 2 years ago
.rubocop.yml Style and lint fixes to support newer ChefDK 5 years ago
.rubocop_todo.yml starting rocky development patch 3 years ago
.zuul.yaml Rename openstack-chef-repo references to openstack-chef 3 years ago
Berksfile Set Berksfile to use ruby solver 2 years ago Workflow documentation is now in infra-manual 7 years ago
LICENSE ops-database refactor for Pike and Chef 13 4 years ago
README.rst Updates for rocky 2 years ago
Rakefile Updates for rocky 2 years ago Sync stackforge/cookbook* to openstack/cookbook* for ops-database cookbook 6 years ago
metadata.rb Updates for rocky 2 years ago


OpenStack Chef Cookbook - ops-database



This cookbook provides a reference example of database configuration for the OpenStack deployment provided by Chef for OpenStack. It currently supports MySQL and PostgreSQL.


  • Chef 14 or higher
  • ChefDK 3.2.30 for testing (also includes Berkshelf for cookbook dependency resolution)


  • ubuntu
  • redhat
  • centos


The following cookbooks are dependencies:

  • 'mariadb', '~> 1.5'
  • 'mysql2_chef_gem' , '~> 2.0'
  • 'mysql', '~> 8.2'
  • 'openstack-common', '~> 18.0.0'


The usage of this cookbook is optional, you may choose to set up your own databases without using this cookbook. If you choose to do so, you will need to do the following:

  • create the schema specified by the openstack-db recipe.
  • create and upload encrypted data bags into your chef environment, as specified by #get_password in the openstack-db recipe.







  • Installs client packages for the database used by the deployment.


  • Installs and configures server packages for the database used by the deployment.


  • Installs MySQL client packages and mysql client python packages.


  • Configures the MySQL server for OpenStack.


  • Installs MariaDB client packages.


  • Installs and configures MariaDB server packages.


  • Installs MariaDB Cluster client packages.


  • Installs and configures MariaDB Cluster server packages.


  • Creates necessary tables, users, and grants for OpenStack.


The following attributes are defined in attributes/database.rb of the common cookbook, but are documented here due to their relevance:

  • openstack['endpoints']['db']['host'] - The IP address to bind the database service to
  • openstack['endpoints']['db']['port'] - The port to bind the database service to
  • openstack['endpoints']['db']['bind_interface'] - The interface name to bind the database service to
  • openstack['db']['root_user_key'] - The key used to retrieve the root user password; the key is both the name of the data-bag item and name of the key containing the password value within the data-bag item. This is defined in Common.

If the value of the bind_interface attribute is non-nil, then the database service will be bound to the first IP address on that interface. If the value of the bind_interface attribute is nil, then the database service will be bound to the IP address specified in the host attribute.

See the attributes mysql.rb file for the mysql specific attributes that are available.

For more information see:


Please refer to the for instructions for testing the cookbook.


Berks will resolve version requirements and dependencies on first run and store these in Berksfile.lock. If new cookbooks become available you can run berks update to update the references in Berksfile.lock. Berksfile.lock will be included in stable branches to provide a known good set of dependencies. Berksfile.lock will not be included in development branches to encourage development against the latest cookbooks.

License and Author

Author Justin Shepherd (
Author Jason Cannavale (
Author Ron Pedde (
Author Joseph Breu (
Author William Kelly (
Author Darren Birkett (
Author Evan Callicoat (
Author Matt Thompson (
Author Matt Ray (
Author Sean Gallagher ()
Author John Dewey (
Author Ionut Artarisi (
Author Mark Vanderwiel (
Author Jan Klare (
Copyright Copyright (c) 2012-2013, Rackspace US, Inc.
Copyright Copyright (c) 2012-2013, Opscode, Inc.
Copyright Copyright (c) 2013, AT&T Services, Inc.
Copyright Copyright (c) 2013-2014, SUSE Linux GmbH
Copyright Copyright (c) 2014-2015, IBM, Corp.

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

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.