Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms


mariadb (53) Versions 1.5.0

Installs/Configures MariaDB

cookbook 'mariadb', '= 1.5.0'
cookbook 'mariadb', '= 1.5.0', :supermarket
knife supermarket install mariadb
knife supermarket download mariadb
Quality 78%

MariaDB Cookbook

Build Status Cookbook Version


This cookbook contains all the stuffs to install and configure a mariadb server on a dpkg/apt compliant system (typically debian), or a rpm/yum compliant system (typically centos)



  • mariadb - This cookbook need that you have a valid apt repository installed with the mariadb official packages


  • percona-xtrabackup - if you want to use the xtrabckup SST Auth for galera cluster.
  • socat - if you want to use the xtrabckup SST Auth for galera cluster.
  • rsync - if you want to use the rsync SST Auth for galera cluster.
  • debconf-utils - if you use debian platform family.

operating system

  • debian - this cookbook is fully tested on debian
  • ubuntu - this cookbook is fully tested on ubuntu
  • centos - this cookbook is fully tested on centos



<table> <tr> <th>Key</th> <th>Type</th> <th>Description</th> <th>Default</th> </tr> <tr> <td><tt>['mariadb']['install']['version']</tt></td> <td>String</td> <td>Version to install (currently 10.0 et 5.5)</td> <td><tt>10.0</tt></td> </tr> <tr> <td><tt>['mariadb']['use_default_repository']</tt></td> <td>Boolean</td> <td>Whether to install MariaDB default repository or not. If you don't have a local repo containing packages, put it to true</td> <td><tt>false</tt></td> </tr> <tr> <td><tt>['mariadb']['server_root_password']</tt></td> <td>String</td> <td>local root password</td> <td><tt></tt></td> </tr> <tr> <td><tt>['mariadb']['forbid_remote_root']</tt></td> <td>Boolean</td> <td>Whether to activate root remote access</td> <td><tt>true</tt></td> </tr> <tr> <td><tt>['mariadb']['allow_root_pass_change']</tt></td> <td>Boolean</td> <td>Whether to allow the recipe to change root password after the first install</td> <td><tt>false</tt></td> </tr> <tr> <td><tt>['mariadb']['client']['development_files']</tt></td> <td>Boolean</td> <td>Whether to install development files in client recipe</td> <td><tt>true</tt></td> </tr> <tr> <td><tt>['mariadb']['apt_repository']['base_url']</tt></td> <td>String</td> <td>The http base url to use when installing from default repository</td> <td><tt>''</tt></td> </tr> <tr> <td><tt>['mariadb']['install']['prefer_os_package']</tt></td> <td>Boolean</td> <td>Indicator for preferring use packages shipped by running os</td> <td><tt>false</tt></td> </tr> <tr> <td><tt>['mariadb']['install']['prefer_scl_package']</tt></td> <td>Boolean</td> <td>Indicator for preferring packages from software collections repository</td> <td><tt>false</tt></td> </tr> </table>


To install a default server for mariadb choose the version you want (MariaDB 5.5 or 10, galera or not), then call the recipe accordingly.

List of availables recipes:

  • mariadb::default (just call server recipe with default options)
  • mariadb::server
  • mariadb::galera
  • mariadb::client
  • mariadb::devel

Please be ware that by default, the root password is empty! If you want have changed it use the node['mariadb']['server_root_password'] attribute to put a correct value. And by default the remote root access is not activated. Use node['mariadb']['forbid_remote_root'] attribute to change it.

Sometimes, the default apt repository used for apt does not work (see issue #6). In this case, you need to choose another mirror which worki (pick it from mariadb website), and put the http base url in the attribute node['mariadb']['apt_repository']['base_url'].


When installing the mariadb::galera on debian recipe, You have to take care of one specific attribute: node['mariadb']['debian']['password'] which default to 'please-change-me' As wee need to have the same password for this user on the whole cluster nodes... We will change the default install one by the content of this attribute.


By default this recipe installs the client, and all needed packages to develop client application. If you do not want to install development files when installing client package, set the attribute node['mariadb']['client']['development_files'] to false.


By default this recipe installs all needed packages to develop client application.


This recipe define 2 providers: - Chef::Provider::Mariadb::Configuration shortcut resource mariadb_configuration


Mainly use for internal purpose. You can use it to create a new configuration file into configuration dir. You have to define 2 variables section and option. Where section is the configuration section, and option is a hash of key/value. The name of the resource is used as base for the filename.

Example: ruby mariadb_configuration 'fake' do section 'mysqld' option :innodb_buffer_pool_size => node['mysql']['innodb_buffer_pool_size'], :innodb_flush_method => node['mysql']['innodb_flush_method'] end will become the file fake.cnf in the include dir (depend on your platform), which contain: [mysqld] foo=bar

If the value start with a '#', then it's considered as a comment, and the value is printed as is (without the key)

Example: ruby mariadb_configuration 'fake' do section 'mysqld' option :comment1 => '# Here i am', :foo => bar end will become the file fake.cnf in the include dir (depend on your platform), which contain: ``` [mysqld]

Here i am

foo=bar ```


This LWRP is used to manage replication setup on a host. To use this LWRP, the node need to have the mysql binary installed (via the mariadb::client or mariadb::server or mariadb::galera recipe). It have 4 actions: - add - to add a new replication setup (become a slave) - stop - to stop the slave replication - start - to start the slave replication - remove - to remove the slave replication configuration

The resource name need to be 'default' if your don't want to use a named connection (multi source replication in MariaDB 10).

So by default the provider try to use the local instance of mysql, with the current root and password set in attribute node['mariadb']['server_root_password']. If you want to change, you have to define host, port, user or password

mariadb_replication 'default' do
  user 'root'
  password 'fakepass'
  host 'fakehost'
  action :stop

will stop the replication on the host fakehost using the user root and password fakepass to connect to.

When you add a replication configuration, you have to define at least 4 values master_host, master_user, master_password and master_use_gtid. And if you don't want the GTID support, you have to define also master_log_file and master_log_pos

Example: ruby mariadb_replication 'usefull_conn_name' do master_host 'server1' master_user 'slave_user' master_password 'slave_password' master_use_gtid 'current_pos' action :add end

By default, resource doesn't change master if slave is running. If you want to let resource change slave settings for replication channel while slave is running use change_master_while_running property. When it's set to true slave settings will be changed if either one of master_host, master_port, master_user, master_password and master_use_gtid was changed.

Changes of only master_log_file and/or master_log_pos don't affect server if slave is already configured.


  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors: Nicolas Blanc

Dependent cookbooks

yum-scl >= 0.0.0
yum-epel >= 0.0.0
yum >= 0.0.0
selinux_policy ~> 2.0
build-essential >= 0.0.0
apt >= 0.0.0

Contingent cookbooks

abiquo Applicable Versions
database_application Applicable Versions
dvwa Applicable Versions
fivem Applicable Versions
kloudspeaker Applicable Versions
letsencrypt-boulder-server Applicable Versions
mysql2_chef_gem Applicable Versions
mysql_chef_gem Applicable Versions
openstack-common Applicable Versions
openstack-ops-database Applicable Versions
slurm Applicable Versions


All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

1.5.0 (2017-04-25)


  • Add the ability to set a custom wsrep_node_port, for when you want to specify a non default wsrep_node_incoming_address value (#152)

1.4.0 (2017-04-21)


  • #128 solved, mysql-libs is prevented from being removed on newer CentOS versions causing Chef to break (#153)


  • mariadb_replication rewritten as a custom resource (#151)


  • Remove Fedora support, tested versions are long gone EOL and hard to support; only latest version has a repo on

1.3.0 (2017-03-20)


  • Add ability to enable and disable server audit logging (#150)

1.2.0 (2017-03-15)


  • Add recipe and attributes to install using Software Collections (SCL) on RedHat family systems (#149)

1.1.0 (2017-03-12)


  • Correctly set server-id and fixed replication provider nil string bug (#118)
  • Make open-files-limit configurable (previously commented out in template) (#118)
  • Fix package name for RedHat family distros using MariaDB 10.1 (#138)


  • Add ability to specify your own gcomm:// address for Galera replication (#139)
  • Add attribute containing my.cnf sections to configure to allow users to override what cookbook manages
  • Add attributes to configure general and slow log options (#137)
  • Add Docker CI tests (add new APT key to fix #107, add Supermarket version badge and change Travis badge to show master build status to README)
  • Add Docker tests to Travis for smoke tests


  • Change CHANGELOG format to follow Keep a Changelog (v0.3.0)
  • Change Chef search results message log level to debug to remove unnecessary output (#90)
  • Update Vagrant box names to match latest OS versions for testing with VirtualBox


  • Remove Fedora platfrom from Test-Kitchen, not something we'll test on going forward
  • Remove Ubuntu 12.04 LTS from Test-Kitchen, not something we'll test on going forward as it reaches EOL in one month



  • Correct ServerSpec tests
  • Correct some Units tests (Use ServerRunner instead of SoloRunner to test search)


  • Add an option to not install extra packages
  • Update OS version to check with Kitchen



  • Fix fetching apt key on every run bug (#91)
  • Fix Foodcritic and RuboCop offences
  • Fix ChefSpec tests (and adding more coverage)
  • Fix some typos
  • Fix CI
  • Fix non-interpolated array
  • Fix only_if
  • Fix unary operator; ensure script exits on any error
  • Prevent cookbook from crashing Chef < 12


  • Add support for configuring skip-name-resolve
  • Add missing code to my.cnf template to deploy mysqld_safe options
  • Add the ability to config skip-log-bin to be present
  • Add MariaDB 10.1 and data bag support
  • Add exception handling, when searching for data bag
  • Add some mandatory attributes and minor fixes
  • Add test for bin_log unset
  • Add sensitive tag to execute statement
  • Add support to disable binlog (by setting log_bin to false)


  • Apply a more standard .gitignore
  • Update chef components to more recent versions
  • Update documentation for 'options' hash
  • Use Berkshelf 4.x and RVM 2.1.7


  • Remove anonymous users and test database by default



  • Add the ability to configure skip-log-bin to be present (#110)



  • Add missing code to my.cnf template to deploy mysqld_safe options (#125)


  • Add support for configuring skip-name-resolve (#126)



  • Add user and password to correct debian-grants (#57)
  • Correct service name inconsistency on CentOS 7 (#68)
  • Fix directory permissions regression (#73)
  • mariadb_configuration template uses current cookbook as template source (#66)
  • Service is restarted every run if not localhost (#76)


  • Add Scientific Linux support (#69)
  • Add a vagrant config to test a Galera cluster (#64)
  • Add xtrabackup-v2 support for SST Method (#71)
  • Allow Galera cluster nodes to be configured when using Chef Solo (#62)



  • Add support for using operating system shipped mariadb packages



  • Push gpg key adds through http/0 - Helps with firewalled installs (#39)
  • Load the needed plugins at startup (#48)


  • Add cookbook attribute on configuration LWRP (#46)
  • Allow to pass true for unary options (#47)



  • Fix TypeError in the replication provider (#43)


  • Add CentOS support (#38)
  • Add sensitive flag to resource that deal with passwords (#40)



  • Audit Plugin test and installation - Correct bad notifies and stdout test



  • Audit plugin installation can crash mariadb server (#36)



  • Add a switch to not launch audit plugin install, when already installed (#29)
  • Remove the only_if to mysql service (#28)
  • When using Galera, nodes were not sorted, applying configuration change too often (#30)


  • Add more ChefSpec coverage (#31)
  • Add a switch to separate server install and audit install when needed
  • Add a RuboCop rule to allow line length to be 120 characters long



  • Fix convert TypeError in the replication provider (#24)
  • Data is now moved when ['mariadb']['mysqld']['datadir'] is changed (#25)


  • Add audit_plugin management (#31)



  • Fix provider mariadb_replication compilation error (#18)


  • Complete CHANGELOG and correct README



  • Fix the debian-sys-maint user creation/password change (#12)
  • Fix the Galera root password preseed (#11)


  • Add a LWRP to manage replication slave (#16)
  • Add attribute to set custom apt_repository's' base_url (#6)
  • Add new tests for the new features (Galera, development files install, replication LWRP)
  • Add option to skip installing development files within client recipe (#17)
  • Add CHANGELOG and add new feature explanations to README



  • Fix FC004 broken rule (#10)
  • Fix Foodcritic tests (add --epic-fail any to be sure it fails when a broken rule is detected) (#9)



  • Fix management of the mysql root password (#4)


  • Add a lot of ChefSpec and kitchen/ServerSpec tests
  • Add ability to add or remove root remote access via attribute (#7)
  • Add immediate restart of the mysql service when port is changed (#5)
  • Add more documentation



  • Fix and add multiple tests
  • Fix client install to add dev files
  • Fix repository install under Debian family



  • Add stove to package/publish cookbook (remove PaxHeaders)



  • Correct the Documentation


  • Add a recipe to manage client only installation
  • Add RPM/Yum management


  • Refactor all tests to manage new platform (CentOS/RedHat/Fedora)
  • Refactor the whole recipes list and management to ease it
  • Rename the provider (from extraconf to configuration) and add matchers for it



  • Add ignore-failure to debian-grants correct as it can break on initial setup



  • Correct a typo (unnecessary call to run_command)



  • Add new rspec tests
  • Create Kitchen test suite
  • Improve Galera configuration management



  • Improve attributes management



  • Adapt galera55 recipe to use a generic galera recipe
  • Improve documentation
  • Use a generic Galera recipe to create the galera10 recipe


  • Initial release of mariadb

Collaborator Number Metric

1.5.0 passed this metric

Contributing File Metric

1.5.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

1.5.0 passed this metric

License Metric

1.5.0 passed this metric

No Binaries Metric

1.5.0 passed this metric

Publish Metric

1.5.0 passed this metric

Supported Platforms Metric

1.5.0 passed this metric

Testing File Metric

1.5.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

1.5.0 passed this metric