default.rb 2.33 KB
#
# Cookbook Name:: cfe-mariadb
# Attributes:: default
#
# Copyright 2016, Chromedia
#
# All rights reserved - Do Not Redistribute
#

## The 'db_map' should contain this format:
# default['cfe-mariadb']['db_map'] = {
#   'example_db_name' => {
#     :db_user       => 'example_db_username',
#     :db_pass       => 'example_db_password',
#     :bak_filename  => 'example_db_name.sql',
#     :bak_maxcopies => 30
## Optional:
#     :char_set => 'latin1',
#     :collate  => 'latin1_swedish_ci'
#   }
# }
default['cfe-mariadb']['db_map']      = {}
# Make sure to set replication on only when necessary
default['cfe-mariadb']['replication'] = false

default['cfe-mariadb']['backup']['s3_region']     = 'us-east-1'
default['cfe-mariadb']['backup']['s3_bucket']     = 'example-bucket'
default['cfe-mariadb']['backup']['aws_bin']       = '/use/local/bin/aws',
default['cfe-mariadb']['backup']['mysqldump_bin'] = '/usr/bin/mysqldump',
# Path to directory where the backup script should be placed
default['cfe-mariadb']['backup']['script_dir']    = ::File.join(
  node['mariadb']['configuration']['path'], 'scripts'
)
default['cfe-mariadb']['backup']['cron']['min']    = '0'
default['cfe-mariadb']['backup']['cron']['hour']   = '0'
default['cfe-mariadb']['backup']['cron']['day']    = '*'
default['cfe-mariadb']['backup']['cron']['mon']    = '*'
default['cfe-mariadb']['backup']['cron']['wday']   = '*'
default['cfe-mariadb']['backup']['cron']['mailto'] = ''

default['mariadb']['server_root_password']   = 'password'
default['mariadb']['mysqld']['bind_address'] = '127.0.0.1'
default['mariadb']['mysqld']['port']         = '3306'
default['mariadb']['install']['type']        = 'package'
default['mariadb']['install']['version']     = '5.5'
default['mariadb']['forbid_remote_root']     = true
# io_capacity has to be roughly the IO capacity of the EC2 instance.
# buffer_pool_size can be increased to 75% (0.75) of RAM if dedicated server.
default['mariadb']['innodb']['io_capacity']      = '600'
default['mariadb']['innodb']['buffer_pool_size'] =
  ( %x(free -m).split(' ')[7].to_i * 0.5 ).round.to_s

## Tip:
## For encrypted attributes like passwords,
## the following is possible in the attributes file:
##
# secret = Chef::EncryptedDataBagItem.load(
#   node['cfe-gitlab']['data_bag'],
#   node['cfe-gitlab']['data_bag_item_secret']
# )
# default['cfe-gitlab']['some_prop'] = secret['db_pass']