diff --git a/multi-node-aio/README.rst b/multi-node-aio/README.rst index f8ef172a..1984a48d 100644 --- a/multi-node-aio/README.rst +++ b/multi-node-aio/README.rst @@ -94,7 +94,7 @@ Notes The cobbler and pre-seed setup has been implemented using some of the awesome work originally created by James Thorne. * cobbler installation post - https://thornelabs.net/2015/11/26/install-and-configure-cobbler-on-ubuntu-1404.html - * pre-seeds -- https://github.com/jameswthorne/preseeds-rpc + * pre-seeds -- https://github.com/jameswthorne/preseeds Options @@ -136,7 +136,7 @@ Instruct the system do all of the cobbler setup: Instruct the system do all of the virsh network setup: ``SETUP_VIRSH_NET=${SETUP_VIRSH_NET:-true}`` -Instruct the system to run the OSA playbooks, if you want to deploy other OSA powered cloud, you can set it to false.: +Instruct the system to run the OSA playbooks, if you want to deploy other OSA powered cloud, you can set it to false: ``RUN_OSA=${RUN_OSA:-true}`` diff --git a/multi-node-aio/functions.rc b/multi-node-aio/functions.rc index f0cd2d6b..0eb8d989 100755 --- a/multi-node-aio/functions.rc +++ b/multi-node-aio/functions.rc @@ -228,3 +228,14 @@ echo -e "Run Time = ${REPORT_OUTPUT}" set -e } +# Return 1 if the second argument is a substring of the first argument, otherwise return 0 +contains() { + string="$1" + substring="$2" + if test "${string#*$substring}" == "$string" + then + echo 0 # $substring is not in $string + else + echo 1 # $substring is in $string + fi +} diff --git a/multi-node-aio/setup-cobbler.sh b/multi-node-aio/setup-cobbler.sh index e2366345..5349d5fb 100755 --- a/multi-node-aio/setup-cobbler.sh +++ b/multi-node-aio/setup-cobbler.sh @@ -143,3 +143,11 @@ done # Restart XinetD service xinetd stop service xinetd start + +# Remove the expired key and opensuse repo, no need after the cobbler being set up. +aptkey_mesg=$(apt-key list) +if [[ $(contains "$aptkey_mesg" "expired") -gt 0 ]]; then + expired_key=$(echo "$aptkey_mesg" | awk /expired/'{print $ sub(".*\/", "")}') + apt-key del $expired_key + add-apt-repository --remove "deb http://download.opensuse.org/repositories/home:/libertas-ict:/cobbler26/xUbuntu_14.04/ ./" +fi