28
|
1 |
# See README.me for options. |
|
2 |
class mysql::server::config { |
|
3 |
|
|
4 |
$options = $mysql::server::options |
|
5 |
$includedir = $mysql::server::includedir |
|
6 |
|
|
7 |
File { |
|
8 |
owner => 'root', |
|
9 |
group => $mysql::server::root_group, |
|
10 |
mode => '0400', |
|
11 |
} |
|
12 |
|
|
13 |
if $includedir and $includedir != '' { |
|
14 |
file { $includedir: |
|
15 |
ensure => directory, |
|
16 |
mode => '0755', |
|
17 |
recurse => $mysql::server::purge_conf_dir, |
|
18 |
purge => $mysql::server::purge_conf_dir, |
|
19 |
} |
|
20 |
} |
|
21 |
|
|
22 |
$logbin = pick($options['mysqld']['log-bin'], $options['mysqld']['log_bin'], false) |
|
23 |
|
|
24 |
if $logbin { |
|
25 |
$logbindir = mysql_dirname($logbin) |
|
26 |
|
|
27 |
#Stop puppet from managing directory if just a filename/prefix is specified |
|
28 |
if $logbindir != '.' { |
|
29 |
file { $logbindir: |
|
30 |
ensure => directory, |
|
31 |
mode => '0755', |
|
32 |
owner => $options['mysqld']['user'], |
|
33 |
group => $options['mysqld']['user'], |
|
34 |
} |
|
35 |
} |
|
36 |
} |
|
37 |
|
|
38 |
if $mysql::server::manage_config_file { |
|
39 |
file { 'mysql-config-file': |
|
40 |
path => $mysql::server::config_file, |
|
41 |
content => template('mysql/my.cnf.erb'), |
|
42 |
mode => '0644', |
|
43 |
selinux_ignore_defaults => true, |
|
44 |
} |
|
45 |
} |
|
46 |
|
|
47 |
if $options['mysqld']['ssl-disable'] { |
|
48 |
notify {'ssl-disable': |
|
49 |
message =>'Disabling SSL is evil! You should never ever do this except if you are forced to use a mysql version compiled without SSL support' |
|
50 |
} |
|
51 |
} |
|
52 |
} |