diff --git a/manifests/script.pp b/manifests/script.pp index 6ceeb8f..0cca354 100644 --- a/manifests/script.pp +++ b/manifests/script.pp @@ -305,7 +305,7 @@ class sunetdrive::script ( $singlenodes.each | $singlenode| { $multinode = hiera_hash('multinode_mapping')[$singlenode]['server'] $multinodeserver = "${multinode}.${site_name}" - $nccontainer = "nextcloud${singlenode}_app_1" + $nccontainer = "nextcloud-${singlenode}_app_1" sunet::scriptherder::cronjob { "listusers_${singlenode}": cmd => "/root/tasks/listusers.sh ${singlenode} ${multinodeserver}", diff --git a/templates/script/backupsinglenodedb.erb.sh b/templates/script/backupsinglenodedb.erb.sh index 344d1d0..53897eb 100644 --- a/templates/script/backupsinglenodedb.erb.sh +++ b/templates/script/backupsinglenodedb.erb.sh @@ -25,7 +25,7 @@ if [[ " ${sixmonths[*]} " =~ " ${customer} " ]]; then else number_of_full_to_keep=1 fi -container="mariadb${customer}_db_1" +container="mariadb-${customer}_db_1" backup_dir="/opt/backups" bucket="db-backups" mirror="${customer}-<%= @environment %>-mirror" diff --git a/templates/script/create_folders_in_singlenode_buckets.erb.sh b/templates/script/create_folders_in_singlenode_buckets.erb.sh index 0bedfd4..27e1fb7 100644 --- a/templates/script/create_folders_in_singlenode_buckets.erb.sh +++ b/templates/script/create_folders_in_singlenode_buckets.erb.sh @@ -5,7 +5,7 @@ shift include_userbuckets="${1}" shift environment="<%= @environment %>" -container="nextcloud${customer}_app_1" +container="nextcloud-${customer}_app_1" yq="/usr/local/bin/yq" if ! [[ -x ${yq} ]]; then diff --git a/templates/script/listusers.erb.sh b/templates/script/listusers.erb.sh index 9e338bc..be0c500 100644 --- a/templates/script/listusers.erb.sh +++ b/templates/script/listusers.erb.sh @@ -4,7 +4,7 @@ customer="${1}" multinode="${2}" environment="<%= @environment %>" location="${customer}-${environment}" -userjson=$(ssh "script@${multinode}" "sudo /home/script/bin/list_users.sh nextcloud${customer}_app_1") +userjson=$(ssh "script@${multinode}" "sudo /home/script/bin/list_users.sh nextcloud-${customer}_app_1") project="statistics" bucket="drive-server-coms" base_dir="${project}:${bucket}" diff --git a/templates/scriptreceiver/create_bucket.erb.sh b/templates/scriptreceiver/create_bucket.erb.sh index b21f487..cecf68c 100755 --- a/templates/scriptreceiver/create_bucket.erb.sh +++ b/templates/scriptreceiver/create_bucket.erb.sh @@ -11,7 +11,7 @@ function usage { exit 1 } -if ! [[ ${container} =~ ^nextcloud[a-z]*_app_1$ ]]; then +if ! [[ ${container} == 'nextcloud_app_1' ]] && ! [[ ${container} =~ ^nextcloud-[a-z]*_app_1$ ]]; then usage fi if ! [[ ${bucket} =~ ^[a-zA-Z0-9]+ ]]; then @@ -26,7 +26,7 @@ echo "$(date): Start executing create_bucket.sh ${1} ${2} ${3}" rclone_config="/opt/nextcloud/rclone.conf" if [[ "${container}" != "nextcloud_app_1" ]]; then - customer=$(echo "${container}" | sed -e 's/^nextcloud//' -e 's/_app_1$//') + customer=$(echo "${container}" | sed -e 's/^nextcloud-//' -e 's/_app_1$//') rclone_config="/opt/multinode/${customer}/rclone.conf" fi diff --git a/templates/scriptreceiver/list_files_for_user.erb.sh b/templates/scriptreceiver/list_files_for_user.erb.sh index 5c23c29..b6e6214 100644 --- a/templates/scriptreceiver/list_files_for_user.erb.sh +++ b/templates/scriptreceiver/list_files_for_user.erb.sh @@ -9,7 +9,7 @@ function usage { exit 1 } -if ! [[ ${container} =~ ^nextcloud[a-z]*_app_1$ ]]; then +if ! [[ ${container} == 'nextcloud_app_1' ]] && ! [[ ${container} =~ ^nextcloud-[a-z]*_app_1$ ]]; then usage fi diff --git a/templates/scriptreceiver/list_users.erb.sh b/templates/scriptreceiver/list_users.erb.sh index c470b30..f69f3b8 100644 --- a/templates/scriptreceiver/list_users.erb.sh +++ b/templates/scriptreceiver/list_users.erb.sh @@ -2,7 +2,7 @@ container=${1} -if ! [[ ${container} =~ ^nextcloud[a-z]*_app_1$ ]]; then +if ! [[ ${container} == 'nextcloud_app_1' ]] && ! [[ ${container} =~ ^nextcloud-[a-z]*_app_1$ ]]; then echo "Usage: ${0} " echo "Example : ${0} nextcloud_app_1" exit 1