From 27d0bc15cc18b0ad99f08fa20f65addc64b4c577 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Mon, 29 Apr 2024 16:39:23 +0200 Subject: [PATCH] Move config def up --- manifests/multinode.pp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/manifests/multinode.pp b/manifests/multinode.pp index c3e2614..040a783 100644 --- a/manifests/multinode.pp +++ b/manifests/multinode.pp @@ -219,6 +219,8 @@ MACAddressPolicy=none' } } $customers.each | $index, $customer | { + $customer_config_full = hiera_hash($customer) + $customer_config = $customer_config_full[$environment] cron { "multinode_cron_${customer}": command => "/opt/nextcloud/cron.sh nextcloud-${customer}_app_1", require => File['/opt/nextcloud/cron.sh'], @@ -226,13 +228,16 @@ MACAddressPolicy=none' minute => '*/10', } if $environment == 'prod' { - $s3_bucket = "primary-${customer}-drive.sunet.se" + if 'primary_bucket' in $customer_config.keys() { + $s3_bucket = $customer_config['primary_bucket'] + } else { + $s3_bucket = "primary-${customer}-drive.sunet.se" + } $site_name = "${customer}.drive.sunet.se" $trusted_proxies = ['lb1.drive.sunet.se','lb2.drive.sunet.se', 'lb3.drive.sunet.se', 'lb4.drive.sunet.se'] } else { - - if "primary_bucket" in $customer_config.keys() { - $s3_bucket = $customer_config["primary_bucket"] + if 'primary_bucket' in $customer_config.keys() { + $s3_bucket = $customer_config['primary_bucket'] } else { $s3_bucket = "primary-${customer}-${environment}.sunet.se" } @@ -244,8 +249,6 @@ MACAddressPolicy=none' $apache_error_path = "/opt/multinode/${customer}/404.html" $config_php_path = "/opt/multinode/${customer}/config.php" $cron_log_path ="/opt/multinode/${customer}/cron.log" - $customer_config_full = hiera_hash($customer) - $customer_config = $customer_config_full[$environment] $dbhost = 'proxysql_proxysql_1' $dbname = "nextcloud_${customer}"