Skip to content

Replication configuration #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
#
# Parameters:
# [*bind_address*] - address to bind service.
# [*binlog_format*] - binary logging format
# [*config_file*] - my.cnf configuration file path.
# [*datadir*] - path to datadir.
# [*default_engine] - configure a default table engine
# [*etc_root_password*] - whether to save /etc/my.cnf.
# [*expire_logs_days*] - no. of days for automatic binary log file removal
# [*log_bin*] - path to mysql binary log, if enabled by *server_id*
# [*log_error] - path to mysql error log
# [*max_binlog_size*] - maximum size of each binary log file
# [*old_root_password*] - previous root user password,
# [*port*] - port to bind service.
# [*restart] - whether to restart mysqld (true/false)
# [*root_group] - use specified group for root-owned files
# [*root_password*] - root user password.
# [*server_id*] - set server ID and enable binary logging
# [*service_name*] - mysql service name.
# [*socket*] - mysql socket.
# [*ssl] - enable ssl
Expand All @@ -35,18 +40,23 @@
#
class mysql::config(
$bind_address = $mysql::bind_address,
$binlog_format = $mysql::binlog_format,
$config_file = $mysql::config_file,
$datadir = $mysql::datadir,
$default_engine = $mysql::default_engine,
$etc_root_password = $mysql::etc_root_password,
$expire_logs_days = $mysql::params::expire_logs_days,
$log_bin = $mysql::params::log_bin,
$log_error = $mysql::log_error,
$max_binlog_size = $mysql::params::max_binlog_size,
$pidfile = $mysql::pidfile,
$port = $mysql::port,
$purge_conf_dir = $mysql::purge_conf_dir,
$restart = $mysql::restart,
$root_group = $mysql::root_group,
$root_password = $mysql::root_password,
$old_root_password = $mysql::old_root_password,
$server_id = $mysql::params::server_id,
$service_name = $mysql::service_name,
$socket = $mysql::socket,
$ssl = $mysql::ssl,
Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
class mysql::params {

$bind_address = '127.0.0.1'
$binlog_format = 'UNSET'
$config_template = 'mysql/my.cnf.erb'
$default_engine = 'UNSET'
$etc_root_password = false
$expire_logs_days = 10
$manage_service = true
$max_binlog_size = 100M
$old_root_password = ''
$package_ensure = 'present'
$purge_conf_dir = false
$port = 3306
$root_password = 'UNSET'
$restart = true
$server_id = 'UNSET'
$ssl = false

case $::operatingsystem {
Expand Down Expand Up @@ -99,6 +103,7 @@
$socket = '/var/run/mysqld/mysqld.sock'
$pidfile = '/var/run/mysqld/mysqld.pid'
$config_file = '/etc/mysql/my.cnf'
$log_bin = '/var/log/mysql/mysql-bin.log'
$log_error = '/var/log/mysql/error.log'
$ruby_package_name = 'libmysql-ruby'
$python_package_name = 'python-mysqldb'
Expand Down
11 changes: 9 additions & 2 deletions templates/my.cnf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@ query_cache_size = 16M
<% if @log_error != 'syslog' -%>
log_error = <%= @log_error %>
<% end -%>
expire_logs_days = 10
max_binlog_size = 100M
<% if @server_id != 'UNSET' -%>
server-id = <%= @server_id %>
log_bin = <%= @log_bin %>
<% end -%>
<% if @binlog_format != 'UNSET' -%>
binlog_format = <%= @binlog_format %>
<% end -%>
expire_logs_days = <%= @expire_logs_days %>
max_binlog_size = <%= @max_binlog_size %>
<% if default_engine != 'UNSET' %>
default-storage-engine = <%= @default_engine %>
<% end %>
Expand Down