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

RSS

mariadb (29) Versions 1.0.1

Installs/Configures MariaDB

Berkshelf/Librarian
Policyfile
Knife
cookbook 'mariadb', '= 1.0.1'
cookbook 'mariadb', '= 1.0.1', :supermarket
knife cookbook site install mariadb
knife cookbook site download mariadb
README
Dependencies
Changelog
Quality

MariaDB Cookbook

Build Status

Description

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)

Requirements

repository

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

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 - not fully tested on ubuntu, but should work
  • centos - not fully tested on centos, but should work

Attributes

mariadb::default

<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>'ftp.igh.cnrs.fr/pub/mariadb/repo'</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> </table>

Usage

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

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'].

mariadb::galera

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.

mariadb::client

By default this recipe install 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.

Providers

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

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

mariadb_replication

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 user and no 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
end

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

Contributing

  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 sinfomicien@gmail.com

mariadb CHANGELOG

This file is used to list changes made in each version of the mariadb cookbook.

1.0.1

  • Add an option to not install extra packages
  • Correct some Units tests (Use ServerRunner instead of SoloRunner to test search)
  • Update OS version to check with Kitchen
  • Correct ServerSpec tests

1.0.0

  • Resolve lint issues in Gemfile
  • Misc lint fixes
  • Apply a more standard .gitignore
  • Disable rubocop inspection of Vagrantfiles + vendor dir
  • Misc CI fixes
  • Add support for configuring skip-name-resolve
  • Add missing code to my.cnf template to deploy mysqld_safe options
  • fix for foodcritic
  • fix unary operator; ensure script exits on any error
  • feat: adds the ability to config skip-log-bin to be present
  • Prevent this cookbook from crashing Chef < 12
  • Correct Issue #91
  • Correct Rubocop Offenses
  • Fix rubocop offences
  • add test for bin_log unset
  • Support binlog disabling (by setting log_bin to false)
  • make databags optional
  • add exception handling, when searching for data bag
  • Rubocop fixes
  • Foodcritic fixes
  • Update chef components to more recent versions
  • Fix unfortunate typo
  • fix only_if
  • fix non-interpolated array
  • fix final specs
  • fix centos specs
  • fix specs
  • use Berkshelf 4.x and rvm 2.1.7
  • fixing FC002 FC009 and FC023
  • fixing attribute typo
  • fixing tests, adding /root/.my.cnf support
  • Add some mandatory attributes and minor fixes
  • Add MariaDB 10.1 and data_bag support
  • Fixed tab to spaces
  • Added sensitive tag to execute statement
  • Remove anonymous users and test database by default
  • update documentation for 'options' hash
  • Fix use of keyserver

0.3.3

  • [ENH #110] - adds the ability to config skip-log-bin to be present

0.3.2

  • [BUG #125] - Add missing code to my.cnf template to deploy mysqld_safe options
  • [ENH #126] - Add support for configuring skip-name-resolve

0.3.1

  • [BUG #76] - Service is restarted every run if not localhost
  • [BUG #73] - Fix directory permissions regression
  • [BUG #69] - Update repository.rb to be able to manage Scientific Linux
  • [BUG #57] - Add user and password to correct debian-grants
  • [ENH #71] - Add xtrabackup-v2 support for SST Method
  • [ENH #62] - Allow Galera cluster nodes to be configured when using Chef Solo
  • [ENH #64] - Add a vagrant config to test a galera cluster
  • [BUG #66] - mariadb_configuration template uses current cookbook as template source
  • [BUG #68] - Correct service name inconsistency on CentOS 7

0.3.0

  • [ENH] - Add support for using operating system shipped mariadb packages

0.2.12

  • [BUG #39] - Push gpg key adds through http/80 - Helps with firewalled installs
  • [ENH #46] - Add cookbook attribute on configuration lwrp
  • [ENH #47] - Allow to pass true for unary options
  • [BUG #48] - Load the needed plugins at startup

0.2.11

  • [ENH #38] - Add CentOS support
  • [ENH #40] - Add sensitive flag to resource that deal with passwords
  • [BUG #43] - Fix convert TypeError in the replication provider

0.2.10

  • [BUG] - Audit Plugin test and installation - Correct bad notifies, and stdout test

0.2.9

  • [BUG #36] - Audit plugin installation can crash mariadb server

0.2.8

  • [BUG #30] - When using galera, nodes were not sorted, applying configuration change too often
  • [BUG #31] - ChefSpec coverage was not 100%
  • [BUG #28] - Remove the only_if to mysql service
  • [BUG #29] - Add a switch to not launch audit plugin install, when already installed
  • [ENH] - Add a switch to separate server install and audit install when needed
  • [ENH] - Add a rule to authorize line length to be 120 characters long

0.2.7

  • [BUG #24] - Fix convert TypeError in the replication provider
  • [BUG #25] - Data are now moved when default datadir is changed
  • [ENH #21] - Add audit_plugin management

0.2.6

  • [BUG #18] - Fix provider mariadb_replication compilation error
  • [DOCS] - Complete Changelog, and correct README

0.2.5

  • [ENH #16] - Add a LWRP to manage replication slave
  • [ENH #17] - Be able to not install development files within client recipe
  • [ENH #11] - Fix the galera root password preseed
  • [BUG #12] - Fix the debian-sys-maint user creation/password change
  • [BUG #6] - Can change the apt repository base_url when the default one fail
  • [TEST] - Add new tests for the new features (galera,development files install,replication LWRP)
  • [DOCS] - Complete Changelog, and add new features explanations into README

0.2.4

  • [BUG #10] - Correct a FC004 broken rule
  • [BUG #9] - Correct foodcritic tests (add --epic-fail any to be sure it fails when a broken rule is detected)

0.2.3

  • [BUG #4] - Add a real management of mysql root password
  • [ENH #5] - Now restart mysql service when port is changed
  • [ENH #7] - Remove or add root remote access via attribute
  • [DOCS] - Complete documentations
  • [TEST] - Add a lot of chefspec and kitchen/serverspec tests

0.2.2

  • [sinfomicien] - Correct repository install under debian family
  • [sinfomicien] - Correct client install to add dev files
  • [sinfomicien] - Correct and add multiples tests

0.2.1

  • [sinfomicien] - Use stove to package (remove PaxHeaders.*)

0.2.0

  • [sinfomicien] - Add rpm/yum management
  • [sinfomicien] - Refactor the whole recipes list and management to ease it
  • [sinfomicien] - Correct the Documentation
  • [sinfomicien] - Rename the provider (from extraconf to configuration), and add matchers to it
  • [sinfomicien] - Add a recipe to manage client only installation
  • [sinfomicien] - Refactor all tests to manage new platform (centos/redhat/fedora)

0.1.8

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

0.1.7

  • [sinfomicien] - Correct a typo (unnecessary call to run_command)

0.1.6

  • [sinfomicien] - improve Galera configuration management
  • [sinfomicien] - Add new rspec tests
  • [sinfomicien] - Create Kitchen test suite

0.1.5

  • [sinfomicien] - improve attributes management

0.1.4

  • [sinfomicien] - adapt galera55 recipe to use a generic galera recipe
  • [sinfomicien] - use a generic galera recipe to create the galera10 recipe
  • [sinfomicien] - Improve documentation

0.1.0

  • [sinfomicien] - Initial release of mariadb

Collaborator Number Metric
            

1.0.1 passed this metric

Collaborator Number Metric
            

1.0.1 passed this metric

Collaborator Number Metric
            

1.0.1 passed this metric

Foodcritic Metric
            

1.0.1 passed this metric

Foodcritic Metric
            

1.0.1 passed this metric

Foodcritic Metric
            

1.0.1 passed this metric

License Metric
            

1.0.1 passed this metric

License Metric
            

1.0.1 passed this metric

License Metric
            

1.0.1 passed this metric

Publish Metric
            

1.0.1 passed this metric

Publish Metric
            

1.0.1 passed this metric

Publish Metric
            

1.0.1 passed this metric

Supported Platforms Metric
            

1.0.1 passed this metric

Supported Platforms Metric
            

1.0.1 passed this metric