New format for multinode container names

This commit is contained in:
Micke Nordin 2023-02-28 09:52:56 +01:00
parent 58a2b4f041
commit 9dd730fcea
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257
7 changed files with 8 additions and 8 deletions

View file

@ -305,7 +305,7 @@ class sunetdrive::script (
$singlenodes.each | $singlenode| { $singlenodes.each | $singlenode| {
$multinode = hiera_hash('multinode_mapping')[$singlenode]['server'] $multinode = hiera_hash('multinode_mapping')[$singlenode]['server']
$multinodeserver = "${multinode}.${site_name}" $multinodeserver = "${multinode}.${site_name}"
$nccontainer = "nextcloud${singlenode}_app_1" $nccontainer = "nextcloud-${singlenode}_app_1"
sunet::scriptherder::cronjob { "listusers_${singlenode}": sunet::scriptherder::cronjob { "listusers_${singlenode}":
cmd => "/root/tasks/listusers.sh ${singlenode} ${multinodeserver}", cmd => "/root/tasks/listusers.sh ${singlenode} ${multinodeserver}",

View file

@ -25,7 +25,7 @@ if [[ " ${sixmonths[*]} " =~ " ${customer} " ]]; then
else else
number_of_full_to_keep=1 number_of_full_to_keep=1
fi fi
container="mariadb${customer}_db_1" container="mariadb-${customer}_db_1"
backup_dir="/opt/backups" backup_dir="/opt/backups"
bucket="db-backups" bucket="db-backups"
mirror="${customer}-<%= @environment %>-mirror" mirror="${customer}-<%= @environment %>-mirror"

View file

@ -5,7 +5,7 @@ shift
include_userbuckets="${1}" include_userbuckets="${1}"
shift shift
environment="<%= @environment %>" environment="<%= @environment %>"
container="nextcloud${customer}_app_1" container="nextcloud-${customer}_app_1"
yq="/usr/local/bin/yq" yq="/usr/local/bin/yq"
if ! [[ -x ${yq} ]]; then if ! [[ -x ${yq} ]]; then

View file

@ -4,7 +4,7 @@ customer="${1}"
multinode="${2}" multinode="${2}"
environment="<%= @environment %>" environment="<%= @environment %>"
location="${customer}-${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" project="statistics"
bucket="drive-server-coms" bucket="drive-server-coms"
base_dir="${project}:${bucket}" base_dir="${project}:${bucket}"

View file

@ -11,7 +11,7 @@ function usage {
exit 1 exit 1
} }
if ! [[ ${container} =~ ^nextcloud[a-z]*_app_1$ ]]; then if ! [[ ${container} == 'nextcloud_app_1' ]] && ! [[ ${container} =~ ^nextcloud-[a-z]*_app_1$ ]]; then
usage usage
fi fi
if ! [[ ${bucket} =~ ^[a-zA-Z0-9]+ ]]; then 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" rclone_config="/opt/nextcloud/rclone.conf"
if [[ "${container}" != "nextcloud_app_1" ]]; then 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" rclone_config="/opt/multinode/${customer}/rclone.conf"
fi fi

View file

@ -9,7 +9,7 @@ function usage {
exit 1 exit 1
} }
if ! [[ ${container} =~ ^nextcloud[a-z]*_app_1$ ]]; then if ! [[ ${container} == 'nextcloud_app_1' ]] && ! [[ ${container} =~ ^nextcloud-[a-z]*_app_1$ ]]; then
usage usage
fi fi

View file

@ -2,7 +2,7 @@
container=${1} 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} <nextcloud container name>" echo "Usage: ${0} <nextcloud container name>"
echo "Example : ${0} nextcloud_app_1" echo "Example : ${0} nextcloud_app_1"
exit 1 exit 1