diff --git a/profile/manifests/mysql/db.pp b/profile/manifests/mysql/db.pp index a5e3c8b6b85302e988aac2708439cf9627549d7f..110be54f7b3c86ae62734cd0799e19ab01713210 100644 --- a/profile/manifests/mysql/db.pp +++ b/profile/manifests/mysql/db.pp @@ -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, } } diff --git a/profile/manifests/wordpress/instance.pp b/profile/manifests/wordpress/instance.pp index 1d74d7d2075d8ff84c91f192845ea16d1103f56a..c3ba59f6e08fc0417b36dab3db54b026e3266b7a 100644 --- a/profile/manifests/wordpress/instance.pp +++ b/profile/manifests/wordpress/instance.pp @@ -3,15 +3,19 @@ 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}") } profile::mysql::db { $db_name: - user => $db_name, - host => 'localhost', - pass => $db_pass, + user => $db_name, + host => 'localhost', + pass => $db_pass, + charset => $charset, + collate => $collate, } $php_socket = "/var/run/php-fpm/${db_name}"