Add sql for roundcube

Signed-off-by: Micke Nordin <kano@sunet.se>
This commit is contained in:
Micke Nordin 2025-03-26 12:48:56 +01:00
parent 249fe90c54
commit 3c815b9a38
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257
2 changed files with 10 additions and 1 deletions

View file

@ -15,6 +15,7 @@ define sunetdrive::db_type(
$backup_password = safe_hiera('backup_password')
$proxysql_password = safe_hiera('proxysql_password')
$mysql_user_password = safe_hiera('mysql_user_password')
$roundcube_password = safe_hiera('rundcube_password')
$mariadb_dir = '/etc/mariadb'
$mycnf_path = 'sunetdrive/mariadb/my.cnf.erb'
$server_id = 1000 + Integer($facts['networking']['hostname'][-1])
@ -46,7 +47,7 @@ define sunetdrive::db_type(
sunet::system_user {'mysql': username => 'mysql', group => 'mysql' }
$sql_files = ['02-backup_user.sql', '03-proxysql.sql', '04-nextcloud.sql']
$sql_files = ['02-backup_user.sql', '03-proxysql.sql', '04-nextcloud.sql', '05-roundcube.sql']
$sql_files.each |$sql_file|{
file { "${mariadb_dir}/init/${sql_file}":
ensure => present,

View file

@ -0,0 +1,8 @@
CREATE SCHEMA roundcube;
CREATE USER 'roundcube'@'%' IDENTIFIED BY '<%= @roundcube_password %>';
GRANT ALL PRIVILEGES ON roundcube.* TO 'roundcube'@'%' IDENTIFIED BY '<%= @roundcube_password %>';
-- USE roundcube;
-- CREATE TABLE `cache` ( `user_id` int(10) unsigned NOT NULL, `cache_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `expires` datetime DEFAULT NULL, `data` longtext NOT NULL, PRIMARY KEY
-- (`user_id`,`cache_key`), KEY `expires_index` (`expires`), CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC
-- CREATE TABLE `users` ( `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `mail_host` varchar(128) NOT NULL, `created` datetime NOT
-- NULL DEFAULT '1000-01-01 00:00:00', `last_login` datetime DEFAULT NULL, `failed_login` datetime DEFAULT NULL, `failed_login_counter` int(10) unsigned DEFAULT NULL, `language` varchar(16) DEFAULT NULL, `preferences` longtext DEFAULT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`,`mail_host`)) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;