Skip to content
Snippets Groups Projects
Commit 229e4c67 authored by drebs's avatar drebs
Browse files

Default WordPress databases do utf8mb3 charset and collation

parent d4bcf82c
No related branches found
No related tags found
1 merge request!38Draft: Merge branch puppet-7 into master
Pipeline #180930 failed
......@@ -4,6 +4,8 @@ define profile::mysql::db (
String $pass = 'password',
String $host = $::fqdn,
Array[String] $grant = ['ALL'],
String $charset = 'utf8',
String $collate = 'utf8_general_ci',
) {
mysql::db { "${title}_${host}":
......@@ -12,6 +14,8 @@ define profile::mysql::db (
dbname => $title,
host => $host,
grant => $grant,
charset => $charset,
collate => $collate,
}
}
......@@ -3,6 +3,8 @@ define profile::wordpress::instance (
String $db_pass,
String $domain = $name,
String $db_name = join(['wp_', regsubst($domain, /[^a-z0-9_]/, '_', 'G')]),
String $charset = 'utf8mb3',
String $collate = 'utf8mb3_general_ci',
) {
if $domain !~ /[a-z0-9_.]+/ {
fail("Invalid domain: ${domain}")
......@@ -12,6 +14,8 @@ define profile::wordpress::instance (
user => $db_name,
host => 'localhost',
pass => $db_pass,
charset => $charset,
collate => $collate,
}
$php_socket = "/var/run/php-fpm/${db_name}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment