Puppet Class: percona::params

Inherited by:
percona
Defined in:
manifests/params.pp

Overview

Class percona::params

Parameters:

$config_include_dir

Folder to include using ‘!includedir’ in the mysql configuration folder. Defaults to /etc/mysql/conf.d for debian. If overridden, we will attempt to create it but the parent directory should exist.

$mgmt_cnf

Path to the my.cnf file to use for authentication.

$manage_repo

This module can optionally install apt/yum repos. Disabled by default.

$service_restart

Should we restart the server after changing the configs? On some systems, this may be a bad thing. Ex: Wait for a maintenance weekend.

$default_configuration

A hash table containing specific options to set for a percona version. It should be a hashtable with for each percona version a sub-entry.

Provided parameters:

$template

Either the configured ($config_)template. Or our default template which is OS specific.

$config_dir

Location of the folder which holds the mysql my.cnf file for your operatingsystem.

$config_file

Location of the default mysql my.cnf config file for your operatingsystem.

Examples:

Setting global and default configuration options.

Todo:

TODO: Document parameters

Parameters:

  • percona_version (Any) (defaults to: '5.1')
  • client (Any) (defaults to: true)
  • config_content (Any) (defaults to: undef)
  • config_dir_mode (Any) (defaults to: '0750')
  • config_file_mode (Any) (defaults to: '0640')
  • config_user (Any) (defaults to: 'root')
  • config_group (Any) (defaults to: 'root')
  • config_template (Any) (defaults to: undef)
  • config_skip (Any) (defaults to: false)
  • config_replace (Any) (defaults to: true)
  • config_include_dir (Any) (defaults to: undef)
  • config_file (Any) (defaults to: undef)
  • server (Any) (defaults to: false)
  • service_enable (Any) (defaults to: true)
  • service_ensure (Any) (defaults to: 'running')
  • service_name (Any) (defaults to: 'mysql')
  • service_restart (Any) (defaults to: true)
  • daemon_group (Any) (defaults to: 'mysql')
  • daemon_user (Any) (defaults to: 'mysql')
  • tmpdir (Any) (defaults to: undef)
  • logdir (Any) (defaults to: '/var/log/percona')
  • logdir_group (Any) (defaults to: 'root')
  • socket (Any) (defaults to: '/var/lib/mysql/mysql.sock')
  • datadir (Any) (defaults to: '/var/lib/mysql')
  • targetdir (Any) (defaults to: '/data/backups/mysql/')
  • errorlog (Any) (defaults to: '/var/log/mysqld.log')
  • pidfile (Any) (defaults to: '/var/run/mysqld/mysqld.pid')
  • manage_repo (Any) (defaults to: false)
  • pkg_client (Any) (defaults to: undef)
  • pkg_server (Any) (defaults to: undef)
  • pkg_common (Any) (defaults to: undef)
  • pkg_compat (Any) (defaults to: undef)
  • pkg_version (Any) (defaults to: undef)
  • mgmt_cnf (Any) (defaults to: undef)
  • default_configuration (Any) (defaults to: { '5.5' => {}, '5.1' => {}, 'global' => {}, })


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'manifests/params.pp', line 43

class percona::params (
  $percona_version   = '5.1',
  $client            = true,
  $config_content    = undef,
  $config_dir_mode   = '0750',
  $config_file_mode  = '0640',
  $config_user       = 'root',
  $config_group      = 'root',
  $config_template   = undef,
  $config_skip       = false,
  $config_replace    = true,
  $config_include_dir = undef,
  $config_file       = undef,
  $server            = false,
  $service_enable    = true,
  $service_ensure    = 'running',
  $service_name      = 'mysql',
  $service_restart   = true,
  $daemon_group      = 'mysql',
  $daemon_user       = 'mysql',
  $tmpdir            = undef,
  $logdir            = '/var/log/percona',
  $logdir_group      = 'root',
  $socket            = '/var/lib/mysql/mysql.sock',
  $datadir           = '/var/lib/mysql',
  $targetdir         = '/data/backups/mysql/',
  $errorlog          = '/var/log/mysqld.log',
  $pidfile           = '/var/run/mysqld/mysqld.pid',
  $manage_repo       = false,

  $pkg_client        = undef,
  $pkg_server        = undef,
  $pkg_common        = undef,
  $pkg_compat        = undef,
  $pkg_version       = undef,

  $mgmt_cnf          = undef,

  $default_configuration  = {
    '5.5'    => {},
    '5.1'    => {},
    'global' => {},
  }
) {

  case $::operatingsystem {
    /(?i:debian|ubuntu)/: {
      $config_dir  = '/etc/mysql'
      $default_config_file = '/etc/mysql/my.cnf'
      $template    = $config_template ? {
        undef   => 'percona/my.cnf.Debian.erb',
        default => $config_template,
      }
      $config_include_dir_default = "${config_dir}/conf.d"
    }

    /(?i:redhat|centos)/: {
      $default_config_file = '/etc/my.cnf'
      $template    = $config_template ? {
        undef   => 'percona/my.cnf.erb',
        default => $config_template,
      }
      $config_include_dir_default = undef
    }

    default: {
      fail('Operating system not supported yet.')
    }
  }

  $_config_file = $config_file ? {
    undef   => $default_config_file,
    default => $config_file,
  }

}