Skip to content
Browse files

Merge pull request #53 from fifteen3/master

enable mysql logging on a dev machine.
  • Loading branch information...
2 parents d43aeeb + 35a29cd commit e1177ea85ddcf9f0c994e91685b9c95a1913aea8 @mikecanz committed Mar 15, 2013
View
22 modules/mysqld/manifests/init.pp
@@ -19,6 +19,26 @@
}
file { "/etc/my.cnf":
- source => "puppet:///modules/mysqld/etc/my.cnf",
+ content => template("mysqld/etc/my.cnf.erb")
+ }
+
+ if $is_dev == "true" {
+
+ file { "/var/log/mysql" :
+ ensure => "directory",
+ owner => "mysql",
+ group => "mysql",
+ mode => 644,
+ }
+
+ file { "/var/log/mysql/query.log":
+ notify => Service['mysqld'],
+ ensure => 'present',
+ owner => 'mysql',
+ group => 'mysql',
+ mode => 0644,
+ content => '',
+ require => Package['mysql-server']
+ }
}
}
View
1 modules/mysqld/files/etc/my.cnf → modules/mysqld/templates/etc/my.cnf.erb
@@ -5,6 +5,7 @@ user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_allowed_packet=16M
+<% if is_dev == "true" %>log=/var/log/mysql/query.log<% end %>
[mysqld_safe]
log-error=/var/log/mysqld.log

0 comments on commit e1177ea

Please sign in to comment.
Something went wrong with that request. Please try again.