From 06020bc48fc256556bc4a5d25e46ed3f674243af Mon Sep 17 00:00:00 2001 From: xiaodongwang Date: Wed, 6 Aug 2014 20:19:36 -0700 Subject: [PATCH] fix install bug Change-Id: I7eecc6c6df45c92ea7d9bf15ad3ad2c74e35c9fe --- conf/os_installer/cobbler.conf | 2 +- conf/package_installer/chef-icehouse.conf | 4 +--- install/cobbler.sh | 1 - install/compass.sh | 9 +++++---- install/install.conf | 5 +++-- install/install.conf.template | 5 +++-- install/prepare.sh | 7 +++++-- requirements.txt | 4 ---- 8 files changed, 18 insertions(+), 19 deletions(-) diff --git a/conf/os_installer/cobbler.conf b/conf/os_installer/cobbler.conf index 240c490f..fb2043af 100644 --- a/conf/os_installer/cobbler.conf +++ b/conf/os_installer/cobbler.conf @@ -1,7 +1,7 @@ NAME = 'cobbler' INSTANCE_NAME = 'cobbler' SETTINGS = { - 'cobbler_url': 'http://127.0.0.1/cobbler_api', + 'cobbler_url': 'http://$cobbler_ip/cobbler_api', 'credentials': { 'username': 'cobbler', 'password': 'cobbler' diff --git a/conf/package_installer/chef-icehouse.conf b/conf/package_installer/chef-icehouse.conf index e72b6c13..b592653e 100644 --- a/conf/package_installer/chef-icehouse.conf +++ b/conf/package_installer/chef-icehouse.conf @@ -1,7 +1,5 @@ NAME = 'chef_installer' INSTANCE_NAME = 'chef_installer' SETTINGS = { - 'chef_url': 'https://10.145.88.150', - 'key_dir': '/root/grace.pem', - 'client_name': 'grace' + 'chef_url': 'https://$chef_ip', } diff --git a/install/cobbler.sh b/install/cobbler.sh index 2ed02b4c..ad1760f2 100755 --- a/install/cobbler.sh +++ b/install/cobbler.sh @@ -9,7 +9,6 @@ if [[ "$?" != "0" ]]; then else # patch cobbler code find /usr/lib -name manage_bind.py |xargs perl -pi.old -e 's/(\s+)(self\.logger\s+\= logger)/$1$2\n$1if self\.logger is None:\n$1 import clogger\n$1 self\.logger = clogger.Logger\(\)/' - echo "cobbler related packages are installed" fi sudo chkconfig cobblerd on diff --git a/install/compass.sh b/install/compass.sh index a45598fb..e33bfaae 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -7,7 +7,7 @@ mkdir -p /var/log/compass mkdir -p /opt/compass/db mkdir -p /var/www/compass -sudo cp -rf $COMPASSDIR/misc/apache/ods-server /etc/httpd/conf.d/ods-server.conf +sudo cp -rf $COMPASSDIR/misc/apache/ods-server.conf /etc/httpd/conf.d/ods-server.conf sudo cp -rf $COMPASSDIR/misc/apache/compass.wsgi /var/www/compass/compass.wsgi sudo cp -rf $COMPASSDIR/conf/* /etc/compass/ sudo cp -rf $COMPASSDIR/service/* /etc/init.d/ @@ -16,9 +16,8 @@ sudo cp -rf $COMPASSDIR/bin/*.sh /opt/compass/bin/ sudo cp -rf $COMPASSDIR/bin/compass /usr/bin/ sudo cp -rf $COMPASSDIR/bin/chef/* /opt/compass/bin/ sudo cp -rf $WEB_HOME/public/* /var/www/compass_web/ -if [[ -f /etc/compass/package_installer/chef-icehouse.conf ]]; then - sudo sed -i "s/127.0.0.1/$ippaddr/g" /etc/compass/package_installer/chef-icehouse.conf -fi +sudo cp -rf $WEB_HOME/v2 /var/www/compass_web/ + # add apache user to the group of virtualenv user sudo usermod -a -G `groups $USER|awk '{print$3}'` apache sudo chkconfig compass-progress-updated on @@ -45,7 +44,9 @@ else fi sudo sed -i "/COBBLER_INSTALLER_URL/c\COBBLER_INSTALLER_URL = 'http:\/\/$ipaddr/cobbler_api'" /etc/compass/setting +sudo sed -i "s/\$cobbler_ip/$ipaddr/g" /etc/compass/os_installer/cobbler.conf sudo sed -i "/CHEF_INSTALLER_URL/c\CHEF_INSTALLER_URL = 'https:\/\/$ipaddr/'" /etc/compass/setting +sudo sed -i "s/\$chef_ip/$ipaddr/g" /etc/compass/package_installer/chef-icehouse.conf sudo sed -i "s/\$compass_ip/$ipaddr/g" /etc/compass/global_config sudo sed -i "s/\$compass_hostname/$HOSTNAME/g" /etc/compass/global_config sudo sed -i "s/\$compass_testmode/$TESTMODE/g" /etc/compass/global_config diff --git a/install/install.conf b/install/install.conf index 5024af41..f50c7e63 100755 --- a/install/install.conf +++ b/install/install.conf @@ -47,13 +47,14 @@ export CENTOS_IMAGE_ARCH=${CENTOS_IMAGE_ARCH:-"x86_64"} export CENTOS_IMAGE_SOURCE=${CENTOS_IMAGE_SOURCE:-"http://mirror.rackspace.com/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION_MAJOR}/isos/${CENTOS_IMAGE_ARCH}/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}-minimal.iso"} export UBUNTU_IMAGE_TYPE=${UBUNTU_IMAGE_TYPE:-"Ubuntu"} -export UBUNTU_IMAGE_VERSION_MAJOR=${UBUNTU_IMAGE_VERSION_MAJOR:-"13"} +export UBUNTU_IMAGE_VERSION_MAJOR=${UBUNTU_IMAGE_VERSION_MAJOR:-"12"} export UBUNTU_IMAGE_VERSION_MINOR=${UBUNTU_IMAGE_VERSION_MINOR:-"04"} +export UBUNTU_IMAGE_PATCH_VERSION=${UBUNTU_IMAGE_PATCH_VERSION:=".4"} export UBUNTU_IMAGE_VERSION=${UBUNTU_IMAGE_VERSION:-"${UBUNTU_IMAGE_VERSION_MAJOR}.${UBUNTU_IMAGE_VERSION_MINOR}"} export UBUNTU_IMAGE_NAME=${UBUNTU_IMAGE_NAME:-"${UBUNTU_IMAGE_TYPE}-${UBUNTU_IMAGE_VERSION}"} export UBUNTU_IMAGE_ARCH=${UBUNTU_IMAGE_ARCH:-"x86_64"} export UBUNTU_IMAGE_ARCH_OTHER=${UBUNTU_IMAGE_ARCH_OTHER:-"amd64"} -export UBUNTU_IMAGE_SOURCE=${UBUNTU_IMAGE_SOURCE:-"http://releases.ubuntu.com/${UBUNTU_IMAGE_VERSION}/${UBUNTU_IMAGE_TYPE,,}-${UBUNTU_IMAGE_VERSION}-server-${UBUNTU_IMAGE_ARCH_OTHER}.iso"} +export UBUNTU_IMAGE_SOURCE=${UBUNTU_IMAGE_SOURCE:-"http://releases.ubuntu.com/${UBUNTU_IMAGE_VERSION}/${UBUNTU_IMAGE_TYPE,,}-${UBUNTU_IMAGE_VERSION}${UBUNTU_IMAGE_PATCH_VERSION}-server-${UBUNTU_IMAGE_ARCH_OTHER}.iso"} export COBBLER_PASSWORD=${COBBLER_PASSWORD:-"cobbler"} diff --git a/install/install.conf.template b/install/install.conf.template index 8e80b9f5..260ee782 100755 --- a/install/install.conf.template +++ b/install/install.conf.template @@ -53,13 +53,14 @@ export CENTOS_IMAGE_ARCH=${CENTOS_IMAGE_ARCH:-"x86_64"} export CENTOS_IMAGE_SOURCE=${CENTOS_IMAGE_SOURCE:-"http://mirror.rackspace.com/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION_MAJOR}/isos/${CENTOS_IMAGE_ARCH}/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}-minimal.iso"} export UBUNTU_IMAGE_TYPE=${UBUNTU_IMAGE_TYPE:-"Ubuntu"} -export UBUNTU_IMAGE_VERSION_MAJOR=${UBUNTU_IMAGE_VERSION_MAJOR:-"13"} +export UBUNTU_IMAGE_VERSION_MAJOR=${UBUNTU_IMAGE_VERSION_MAJOR:-"12"} export UBUNTU_IMAGE_VERSION_MINOR=${UBUNTU_IMAGE_VERSION_MINOR:-"04"} +export UBUNTU_IMAGE_PATCH_VERSION=${UBUNTU_IMAGE_PATCH_VERSION:=".4"} export UBUNTU_IMAGE_VERSION=${UBUNTU_IMAGE_VERSION:-"${UBUNTU_IMAGE_VERSION_MAJOR}.${UBUNTU_IMAGE_VERSION_MINOR}"} export UBUNTU_IMAGE_NAME=${UBUNTU_IMAGE_NAME:-"${UBUNTU_IMAGE_TYPE}-${UBUNTU_IMAGE_VERSION}"} export UBUNTU_IMAGE_ARCH=${UBUNTU_IMAGE_ARCH:-"x86_64"} export UBUNTU_IMAGE_ARCH_OTHER=${UBUNTU_IMAGE_ARCH_OTHER:-"amd64"} -export UBUNTU_IMAGE_SOURCE=${UBUNTU_IMAGE_SOURCE:-"http://releases.ubuntu.com/${UBUNTU_IMAGE_VERSION}/${UBUNTU_IMAGE_TYPE,,}-${UBUNTU_IMAGE_VERSION}-server-${UBUNTU_IMAGE_ARCH_OTHER}.iso"} +export UBUNTU_IMAGE_SOURCE=${UBUNTU_IMAGE_SOURCE:-"http://releases.ubuntu.com/${UBUNTU_IMAGE_VERSION}/${UBUNTU_IMAGE_TYPE,,}-${UBUNTU_IMAGE_VERSION}${UBUNTU_IMAGE_PATCH_VERSION}-server-${UBUNTU_IMAGE_ARCH_OTHER}.iso"} export COBBLER_PASSWORD=${COBBLER_PASSWORD:-"cobbler"} diff --git a/install/prepare.sh b/install/prepare.sh index 4e83f4e1..ae244ba2 100755 --- a/install/prepare.sh +++ b/install/prepare.sh @@ -158,14 +158,17 @@ fi #update mysqld sudo service mysqld restart MYSQL_USER=${MYSQL_USER:-root} -MYSQL_OLD_PASSWORD=${MYSQL_OLD_PASSWORD:-} +MYSQL_OLD_PASSWORD=${MYSQL_OLD_PASSWORD:-root} MYSQL_PASSWORD=${MYSQL_PASSWORD:-root} MYSQL_SERVER=${MYSQL_SERVER:-127.0.0.1} MYSQL_PORT=${MYSQL_PORT:-3306} MYSQL_DATABASE=${MYSQL_DATABASE:-db} # first time set mysql password -sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} password ${MYSQL_PASSWORD} sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} -p"${MYSQL_OLD_PASSWORD}" password ${MYSQL_PASSWORD} +if [[ "$?" != "0" ]]; then +echo "setting up mysql initial password" +sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} password ${MYSQL_PASSWORD} +fi mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "show databases;" if [[ "$?" != "0" ]]; then echo "mysql password set failed" diff --git a/requirements.txt b/requirements.txt index 459cfbd6..61545fbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,3 @@ PyChef simplejson requests redis - - - -