Remove the expired key and opensuse repo after cobbler being installed

Remove the opensuse expired key and opensuse cobbler repo after
cobbler being installed. OSA deployment doesn't need it.

And fix a typo and a link of README.rst

Change-Id: I24f5d823806f039d879dd69762b2eac3a6005628
This commit is contained in:
Weezer Su 2016-10-20 16:13:46 -05:00
parent 1b4cb5699a
commit c8f1af0bcf
3 changed files with 21 additions and 2 deletions

View File

@ -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}``

View File

@ -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
}

View File

@ -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