From c167b1ea5c70fecced7a757fc20e732dfb508b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bergstro=CC=88m?= Date: Thu, 24 May 2018 10:16:14 +0200 Subject: [PATCH] changed COSMOS_REPO to add more -common-dirs --- .../eid/templates/kvm/bootstrap-cosmos.sh.erb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/global/overlay/etc/puppet/modules/eid/templates/kvm/bootstrap-cosmos.sh.erb b/global/overlay/etc/puppet/modules/eid/templates/kvm/bootstrap-cosmos.sh.erb index d3c62f49..64c0f580 100755 --- a/global/overlay/etc/puppet/modules/eid/templates/kvm/bootstrap-cosmos.sh.erb +++ b/global/overlay/etc/puppet/modules/eid/templates/kvm/bootstrap-cosmos.sh.erb @@ -80,10 +80,21 @@ hostname $cmd_hostname # Set up cosmos models. They are in the order of most significant first, so we want # -_host_type=`echo $cmd_hostname | cut -d - -f 1` +_host_types=`echo $cmd_hostname | awk -F[-.] ' +{ + for (i = 1; i <= NF; i++) { + if (i > 1) + var=var "-" + var=var $i + print var + } +}'` + models=$( echo -n '\\$COSMOS_REPO/'"$cmd_hostname/:" - test -d /var/cache/cosmos/repo/${_host_type}-common && echo -n '\\$COSMOS_REPO/'"${_host_type}-common/:" + for _i in $_host_types; do + test -d /var/cache/cosmos/repo/${_i}-common && echo -n '\\$COSMOS_REPO/'"${_i}-common/:" + done echo -n '\\$COSMOS_REPO/global/' ) echo "Configuring cosmos with the following models:"