summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorGabriel Filion <gabster@lelutin.ca>2014-03-12 16:26:32 -0400
committerGabriel Filion <gabster@lelutin.ca>2014-03-12 16:26:32 -0400
commit102de3b0e7c6e2f1ace419e028ed1c3920735d42 (patch)
treed9c47802173c796013d08c7577edd8abd954bed0 /manifests
parent84fba22bad4d2d0e88352c999cabe4de2a42c023 (diff)
parentb06570a940a705988360553446daa8ea52e60f27 (diff)
Merge branch 'conf_define'
Diffstat (limited to 'manifests')
-rw-r--r--manifests/conf.pp37
-rw-r--r--manifests/server/base.pp8
2 files changed, 45 insertions, 0 deletions
diff --git a/manifests/conf.pp b/manifests/conf.pp
new file mode 100644
index 0000000..f9cbeb3
--- /dev/null
+++ b/manifests/conf.pp
@@ -0,0 +1,37 @@
+# $config needs to be a hash of key => value pairs.
+#
+# values in config are output as key = value, except when the value is empty;
+# then just key is output. if you need to output an empty value in the form
+# key = value, then you can specify empty quotes as the value (see example).
+#
+# mysql::conf { 'test':
+# ensure => present,
+# section => 'mysqld',
+# config => {
+# table_cache => '15000',
+# skip_slave => '',
+# something => '""',
+# }
+# }
+#
+# This will generate the following contents:
+# [mysqld]
+# skip_slave
+# something = ""
+# table_cache = 15000
+#
+define mysql::conf (
+ $section,
+ $config,
+ $ensure = present
+) {
+
+ include mysql::server::base
+
+ file { "/etc/mysql/conf.d/${name}.cnf":
+ ensure => $ensure,
+ content => template('mysql/conf.erb'),
+ notify => Service['mysql'],
+ }
+
+}
diff --git a/manifests/server/base.pp b/manifests/server/base.pp
index b379f5c..7bbf30d 100644
--- a/manifests/server/base.pp
+++ b/manifests/server/base.pp
@@ -92,4 +92,12 @@ class mysql::server::base {
Mysql_user<<| tag == "mysql_${::fqdn}" |>>
Mysql_grant<<| tag == "mysql_${::fqdn}" |>>
}
+
+ file { '/etc/mysql/conf.d':
+ ensure => directory,
+ owner => 'root',
+ group => 0,
+ mode => '0755',
+ }
+
}