Initial version MySQL module.
This commit is contained in:
parent
685ecc9810
commit
598a1d440b
3 changed files with 76 additions and 0 deletions
11
mysql/files/my.cnf
Normal file
11
mysql/files/my.cnf
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[mysqld]
|
||||||
|
datadir=/var/lib/mysql
|
||||||
|
socket=/var/lib/mysql/mysql.sock
|
||||||
|
user=mysql
|
||||||
|
# Default to using old password format for compatibility with mysql 3.x
|
||||||
|
# clients.
|
||||||
|
old_passwords=1
|
||||||
|
|
||||||
|
[mysqld_safe]
|
||||||
|
log-error=/var/log/mysqld.log
|
||||||
|
pid-file=/var/run/mysqld/mysqld.pid
|
9
mysql/files/mysql.logrotate
Normal file
9
mysql/files/mysql.logrotate
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
/var/log/mysqld*.log {
|
||||||
|
create 0640 mysql mysql
|
||||||
|
notifempty
|
||||||
|
daily
|
||||||
|
compress
|
||||||
|
postrotate
|
||||||
|
mysqladmin -ulogrotate flush-logs
|
||||||
|
endscript
|
||||||
|
}
|
56
mysql/manifests/init.pp
Normal file
56
mysql/manifests/init.pp
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
|
||||||
|
# Install MySQL client utilities.
|
||||||
|
#
|
||||||
|
class mysql::client {
|
||||||
|
|
||||||
|
package { "mysql":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Install MySQL server
|
||||||
|
#
|
||||||
|
class mysql::server {
|
||||||
|
|
||||||
|
package { "mysql-server":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
service { "mysqld":
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
require => Package["mysql-server"],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/etc/my.cnf":
|
||||||
|
ensure => present,
|
||||||
|
source => [ "puppet:///files/mysql/my.cnf.${hostname}",
|
||||||
|
"puppet:///files/mysql/my.cnf",
|
||||||
|
"puppet:///mysql/my.cnf", ],
|
||||||
|
mode => 0644,
|
||||||
|
owner => root,
|
||||||
|
group => root,
|
||||||
|
require => Package["mysql-server"],
|
||||||
|
notify => Service["mysqld"],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/etc/logrotate.d/mysql":
|
||||||
|
ensure => present,
|
||||||
|
source => "puppet:///mysql/mysql.logrotate",
|
||||||
|
mode => 0644,
|
||||||
|
owner => root,
|
||||||
|
group => root,
|
||||||
|
require => Package["mysql-server"],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/var/lib/mysql":
|
||||||
|
ensure => directory,
|
||||||
|
mode => 0700,
|
||||||
|
owner => mysql,
|
||||||
|
group => mysql,
|
||||||
|
require => Package["mysql-server"],
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue