summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2019-02-10 13:25:51 +0000
committerintrigeri <intrigeri@boum.org>2019-02-10 13:25:51 +0000
commit8b32b1f8bd66c27b8cd7151c2b325916e494f101 (patch)
tree707f4558c0fdd03af8bea19da88fc04a753f6d85
parent29ad49408f5dbb3e623c6c5bf4d9615041a6cdd8 (diff)
Port icingaweb2 to puppetlabs/mysql (#15513)feature15513
-rw-r--r--manifests/monitoring/icingaweb2/mysql.pp31
1 files changed, 15 insertions, 16 deletions
diff --git a/manifests/monitoring/icingaweb2/mysql.pp b/manifests/monitoring/icingaweb2/mysql.pp
index c2ce50a..a34972e 100644
--- a/manifests/monitoring/icingaweb2/mysql.pp
+++ b/manifests/monitoring/icingaweb2/mysql.pp
@@ -15,21 +15,20 @@ class tails::monitoring::icingaweb2::mysql (
default => directory,
}
- @@mysql_database { $web_db_name:
- ensure => $ensure,
- tag => "mysql_${::fqdn}",
- }
-
- @@mysql_user { "${web_db_user}@localhost":
- password_hash => mysql_password($web_db_pass),
- require => Mysql_database[$web_db_name],
- tag => "mysql_${::fqdn}",
- }
-
- @@mysql_grant { "${web_db_user}@localhost/${web_db_name}":
- privileges => all,
- require => Mysql_user["${web_db_user}@localhost"],
- tag => "mysql_${::fqdn}",
+ mysql::db { $web_db_name:
+ ensure => $ensure,
+ # XXX: charset and collate look wrong, but that's what "show
+ # variables like '%_database'" tells me we have, so let's not mess
+ # it up. We might want to convert this database to the current
+ # Debian defaults some day (in Stretch: utf8mb4,
+ # utf8mb4_general_ci).
+ charset => 'latin1',
+ collate => 'latin1_swedish_ci',
+ user => $web_db_user,
+ password => $web_db_pass,
+ host => 'localhost',
+ grant => ['ALL'],
+ tag => "mysql_${::fqdn}",
}
file { '/usr/local/sbin/install_icingaweb2_database':
@@ -54,7 +53,7 @@ class tails::monitoring::icingaweb2::mysql (
command => "/usr/local/sbin/install_icingaweb2_database '${web_db_name}' '${web_db_user}' '${web_db_pass}' '${web_user_pass}'",
creates => '/var/lib/icingaweb2/.db_installed',
require => [
- Mysql_grant["${web_db_user}@localhost/${web_db_name}"],
+ Mysql::Db[$web_db_name],
File['/var/lib/icingaweb2'],
],
}