From 5be9aedc56bd106a3ad56324ad8d3b03abb6137a Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Wed, 26 Apr 2023 16:25:29 +0200 Subject: [PATCH 1/6] Fix so cron job only runns in common --- manifests/script.pp | 50 +++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/manifests/script.pp b/manifests/script.pp index 2f7c200..5a2beae 100644 --- a/manifests/script.pp +++ b/manifests/script.pp @@ -218,6 +218,9 @@ class sunetdrive::script ( group => 'root', mode => '0700', } + file { '/root/tasks/backupsinglenodedb.sh': + ensure => absent, + } if $environment == 'test' { sunet::scriptherder::cronjob { 'reboot-customer': cmd => '/root/tasks/reboot-customer.sh', @@ -263,8 +266,8 @@ class sunetdrive::script ( # Opt in to folder structure in projectbuckets if $customer in ['gih', 'mdu'] { sunet::scriptherder::cronjob { 'create_folders_in_project_buckets': - cmd => 'true', ensure => absent, + cmd => 'true', } file { '/root/tasks/create_folders_in_project_buckets.sh': ensure => absent, @@ -293,24 +296,21 @@ class sunetdrive::script ( warn_criteria => ['exit_status=1','max_age=2h'], } } - file { '/root/tasks/backupsinglenodedb.sh': - ensure => absent, - } - file { '/root/tasks/backupmultinodedb.sh': - ensure => file, - content => template('sunetdrive/script/backupmultinodedb.erb.sh'), - owner => 'root', - group => 'root', - mode => '0700', - } - sunet::scriptherder::cronjob { "backupmultinodedb": - cmd => "/root/tasks/backupmultinodedb.sh", - hour => '2', - minute => '0', - ok_criteria => ['exit_status=0','max_age=2d'], - warn_criteria => ['exit_status=1','max_age=3d'], - } if $customer == 'common' { + file { '/root/tasks/backupmultinodedb.sh': + ensure => file, + content => template('sunetdrive/script/backupmultinodedb.erb.sh'), + owner => 'root', + group => 'root', + mode => '0700', + } + sunet::scriptherder::cronjob { 'backupmultinodedb': + cmd => '/root/tasks/backupmultinodedb.sh', + hour => '2', + minute => '0', + ok_criteria => ['exit_status=0','max_age=2d'], + warn_criteria => ['exit_status=1','max_age=3d'], + } if $environment == 'prod' { file { '/root/tasks/aggregate.sh': ensure => file, @@ -326,15 +326,25 @@ class sunetdrive::script ( ok_criteria => ['exit_status=0','max_age=2d'], warn_criteria => ['exit_status=1','max_age=3d'], } + } + } else { + # Not common + file { '/root/tasks/backupmultinodedb.sh': + ensure => absent, } + sunet::scriptherder::cronjob { 'backupmultinodedb': + ensure => absent, + cmd => 'true', + } + } $singlenodes.each | $singlenode| { $multinode = hiera_hash('multinode_mapping')[$singlenode]['server'] $multinodeserver = "${multinode}.${site_name}" $nccontainer = "nextcloud-${singlenode}_app_1" sunet::scriptherder::cronjob { "backup${singlenode}db": - ensure => absent, - cmd => 'true', + ensure => absent, + cmd => 'true', } sunet::scriptherder::cronjob { "listusers_${singlenode}": cmd => "/root/tasks/listusers.sh ${singlenode} ${multinodeserver}", From ef7c470244c25e9d393d160334f806b4551cdb4f Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Wed, 26 Apr 2023 16:28:40 +0200 Subject: [PATCH 2/6] If at first you don succeed... --- manifests/script.pp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/manifests/script.pp b/manifests/script.pp index 5a2beae..ccb03ad 100644 --- a/manifests/script.pp +++ b/manifests/script.pp @@ -327,16 +327,6 @@ class sunetdrive::script ( warn_criteria => ['exit_status=1','max_age=3d'], } } - } else { - # Not common - file { '/root/tasks/backupmultinodedb.sh': - ensure => absent, - } - sunet::scriptherder::cronjob { 'backupmultinodedb': - ensure => absent, - cmd => 'true', - } - } $singlenodes.each | $singlenode| { $multinode = hiera_hash('multinode_mapping')[$singlenode]['server'] $multinodeserver = "${multinode}.${site_name}" @@ -387,6 +377,13 @@ class sunetdrive::script ( warn_criteria => ['exit_status=1','max_age=3d'], } } else { + file { '/root/tasks/backupmultinodedb.sh': + ensure => absent, + } + sunet::scriptherder::cronjob { 'backupmultinodedb': + ensure => absent, + cmd => 'true', + } sunet::scriptherder::cronjob { 'backupdb': cmd => "/root/tasks/backupdb.sh ${backup_server}", hour => '2', From ca2cf7e3f232d7bce8a4465c160d1738867b17f3 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Thu, 27 Apr 2023 16:44:06 +0200 Subject: [PATCH 3/6] Allow file locks to be debug logged for sunet test --- templates/application/config.php.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/application/config.php.erb b/templates/application/config.php.erb index 0faea1f..f804137 100644 --- a/templates/application/config.php.erb +++ b/templates/application/config.php.erb @@ -35,6 +35,9 @@ $CONFIG = array ( '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 %>', +<% if @location == 'sunet-test' -%> + 'filelocking.debug' => true, +<% end -%> 'forcessl' => true, 'gs.enabled' => '<%= @gs_enabled %>', 'gs.federation' => '<%= @gs_federation %>', From 52c11917ce55cbdf627707db20e178770fea4baa Mon Sep 17 00:00:00 2001 From: Fredrik Kjellman Date: Wed, 3 May 2023 15:00:24 +0200 Subject: [PATCH 4/6] modify mappingfile for GSS to help SHH to login. --- templates/application/mappingfile-test.json.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/application/mappingfile-test.json.erb b/templates/application/mappingfile-test.json.erb index 06b3d0d..b74ecb8 100644 --- a/templates/application/mappingfile-test.json.erb +++ b/templates/application/mappingfile-test.json.erb @@ -9,8 +9,8 @@ "/gih.se$/": "gih.drive.test.sunet.se", "/gu.se$/": "gu.drive.test.sunet.se", "/hb.se$/": "hb.drive.test.sunet.se", - "/shh.se$/": "shh.drive.test.sunet.se", - "/hh.se$/": "hh.drive.test.sunet.se", + "/@shh.se$/": "shh.drive.test.sunet.se", + "/@hh.se$/": "hh.drive.test.sunet.se", "/hhs.se$/": "hhs.drive.test.sunet.se", "/hig.se$/": "hig.drive.test.sunet.se", "/his.se$/": "his.drive.test.sunet.se", From fc4b51b4acb15438c8d8d9f118115fda4f24d05c Mon Sep 17 00:00:00 2001 From: Fredrik Kjellman Date: Mon, 8 May 2023 09:14:00 +0200 Subject: [PATCH 5/6] update mapping file to fix problems for shh.se --- templates/application/mappingfile-prod.json.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/application/mappingfile-prod.json.erb b/templates/application/mappingfile-prod.json.erb index 2b0b4f4..0f2b606 100644 --- a/templates/application/mappingfile-prod.json.erb +++ b/templates/application/mappingfile-prod.json.erb @@ -9,8 +9,8 @@ "/gih.se$/": "gih.drive.sunet.se", "/gu.se$/": "gu.drive.sunet.se", "/hb.se$/": "hb.drive.sunet.se", - "/shh.se$/": "shh.drive.sunet.se", - "/hh.se$/": "hh.drive.sunet.se", + "/@shh.se$/": "shh.drive.sunet.se", + "/@hh.se$/": "hh.drive.sunet.se", "/hhs.se$/": "hhs.drive.sunet.se", "/hig.se$/": "hig.drive.sunet.se", "/his.se$/": "his.drive.sunet.se", From 149ae70210f5a4a7b1bfeac97f1f8a54036357ae Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Fri, 12 May 2023 16:23:22 +0200 Subject: [PATCH 6/6] Add dns --- manifests/satosa.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/satosa.pp b/manifests/satosa.pp index 9729dd1..10f6c1f 100644 --- a/manifests/satosa.pp +++ b/manifests/satosa.pp @@ -32,6 +32,7 @@ class sunetdrive::satosa($dehydrated_name=undef,$image='docker.sunet.se/satosa', sunet::docker_run {'satosa': image => $image, imagetag => $tag, + dns => ['89.32.32.32'], volumes => ['/etc/satosa:/etc/satosa','/etc/dehydrated:/etc/dehydrated'], ports => ['443:8000'], env => ['METADATA_DIR=/etc/satosa/metadata', 'WORKER_TIMEOUT=120']