Enable multinode servers to use external db

This commit is contained in:
Micke Nordin 2023-03-10 12:50:55 +01:00
parent 25d8d94b70
commit d09dc50d0f
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257
3 changed files with 18 additions and 3 deletions

View file

@ -16,6 +16,8 @@ define sunetdrive::app_type (
# Other settings
$admin_password = $config[ 'admin_password' ]
$dbhost = $config[ 'dbhost' ]
$dbname = $config[ 'dbname' ]
$dbuser = $config[ 'dbuser' ]
$instanceid = $config[ 'instanceid' ]
$mysql_user_password = $config[ 'mysql_user_password' ]
$passwordsalt = $config[ 'passwordsalt' ]
@ -30,6 +32,8 @@ define sunetdrive::app_type (
# Other settings
$admin_password = safe_hiera('admin_password')
$dbhost = 'proxysql_proxysql_1'
$dbname = 'nextcloud'
$dbuser = 'nextcloud'
$instanceid = safe_hiera('instanceid')
$mysql_user_password = safe_hiera('mysql_user_password')
$passwordsalt = safe_hiera('passwordsalt')

View file

@ -212,7 +212,16 @@ MACAddressPolicy=none'
$cron_log_path ="/opt/multinode/${customer}/cron.log"
$customer_config_full = hiera_hash($customer)
$customer_config = $customer_config_full[$environment]
$dbhost = "mariadb-${customer}_db_1"
if $customer in ['vr'] and $environment == 'test' {
$dbhost = 'proxysql_proxysql_1'
$dbname = "nextcloud_${customer}"
$dbuser = "nextcloud_${customer}"
} else {
$dbhost = "mariadb-${customer}_db_1"
$dbname = 'nextcloud'
$dbuser = 'nextcloud'
}
$gs_enabled = hiera('gs_enabled')
$gs_federation = hiera('gs_federation')
@ -254,6 +263,8 @@ MACAddressPolicy=none'
admin_password => $admin_password,
backup_password => $backup_password,
dbhost => $dbhost,
dbname => $dbname,
dbuser => $dbuser,
drive_email_template_plain_text_left => hiera($environment)['drive_email_template_plain_text_left'],
drive_email_template_text_left => hiera($environment)['drive_email_template_text_left'],
drive_email_template_url_left => hiera($environment)['drive_email_template_url_left'],

View file

@ -124,12 +124,12 @@ $CONFIG = array (
'config_is_read_only' => true,
'datadirectory' => '/var/www/html/data',
'dbhost' => '<%= @dbhost %>',
'dbname' => 'nextcloud',
'dbname' => '<%= @dbname %>',
'dbpassword' => '<%= @mysql_user_password %>',
'dbport' => '3306',
'dbtableprefix' => 'oc_',
'dbtype' => 'mysql',
'dbuser' => 'nextcloud',
'dbuser' => '<%= @dbuser %>',
'drive_email_template_text_left' => '<%= @drive_email_template_text_left %>',
'drive_email_template_plain_text_left' => '<%= @drive_email_template_plain_text_left %>',
'drive_email_template_url_left' => '<%= @drive_email_template_url_left %>',