diff options
author | blsaws <bryan.sullivan@att.com> | 2016-05-17 06:56:15 -0700 |
---|---|---|
committer | blsaws <bryan.sullivan@att.com> | 2016-05-17 06:56:15 -0700 |
commit | 4c972868690788e9a186bfffd84ff19188ec4dff (patch) | |
tree | a91f26b6bdc6de3dcfe7948c450a0e7f70a1ab96 /components/congress/install/bash | |
parent | 8dcfe1a692815ee3a34dca32fd427471dfd0046a (diff) |
Initial Centos scripts (incomplete)
JIRA: COPPER-2
Change-Id: I28c513995fba02b025ed3e23f58b957ab88ea801
Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'components/congress/install/bash')
-rw-r--r-- | components/congress/install/bash/centos/install_congress_1.sh | 29 | ||||
-rw-r--r-- | components/congress/install/bash/centos/install_congress_2.sh | 28 |
2 files changed, 24 insertions, 33 deletions
diff --git a/components/congress/install/bash/centos/install_congress_1.sh b/components/congress/install/bash/centos/install_congress_1.sh index 47137ae..19f3d29 100644 --- a/components/congress/install/bash/centos/install_congress_1.sh +++ b/components/congress/install/bash/centos/install_congress_1.sh @@ -18,6 +18,7 @@ # Prequisites: # OPFNV install per https://wiki.opnfv.org/display/copper/Apex # On the jumphost, logged in as stack on the undercloud VM: +# Download and save admin-openrc.sh from the overcloud Horizon at ~/ # su stack # Clone the Copper repo and run the install script: # git clone https://gerrit.opnfv.org/gerrit/copper @@ -27,15 +28,13 @@ if [ $# -gt 1 ] && [ $2 == "debug" ]; then set -x #echo on fi cd ~ +# Setup undercloud environment so we can get overcloud Controller server address source ~/stackrc # Get addresses of Controller node(s) export CONTROLLER_HOST1=$(openstack server list | awk "/overcloud-controller-0/ { print \$8 }" | sed 's/ctlplane=//g') export CONTROLLER_HOST2=$(openstack server list | awk "/overcloud-controller-1/ { print \$8 }" | sed 's/ctlplane=//g') -# puppet apply -e "user { 'congress': ensure => present, password => sha1('congress'), }" -# ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ssh heat-admin@$CONTROLLER_HOST1 "useradd congress; exit" - echo "Create the environment file and copy to the congress server" cat <<EOF >~/env.sh export CONGRESS_HOST=$CONTROLLER_HOST1 @@ -47,23 +46,27 @@ export NEUTRON_HOST=$CONTROLLER_HOST1 export NOVA_HOST=$CONTROLLER_HOST1 EOF source ~/env.sh -scp ~/stackrc heat-admin@$CONTROLLER_HOST1:/home/heat-admin/admin-openrc.sh -scp ~/env.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin +scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/env.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin + +# Setup env for overcloud +source ~/overcloudrc +sed -i -- 's/echo "Please/# echo "Please/g' ~/admin-openrc.sh +sed -i -- 's/read -sr OS_PASSWORD_INPUT/# read -sr OS_PASSWORD_INPUT/g' ~/admin-openrc.sh +sed -i -- 's/export OS_PASSWORD=$OS_PASSWORD_INPUT/export OS_PASSWORD='$OS_PASSWORD'/g' ~/admin-openrc.sh +source ~/admin-openrc.sh +scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/admin-openrc.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin echo "Copy install_congress_2.sh to the congress server and execute" -scp ~/git/copper/components/congress/joid/install_congress_2.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin +scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/git/copper/components/congress/joid/install_congress_2.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@$CONTROLLER_HOST1 "source ~/install_congress_2.sh; exit" echo "Install jumphost dependencies" -echo "Update package repos" -sudo apt-get update - echo "install pip" -sudo apt-get install python-pip -y +sudo yum install python-pip -y echo "install other dependencies" -sudo apt-get install apg git gcc python-dev libxml2 libxslt1-dev libzip-dev -y +sudo yum install apg git gcc libxml2 python-devel libzip-devel libxslt-devel -y sudo pip install --upgrade pip virtualenv setuptools pbr tox echo "Clone congress" @@ -123,7 +126,7 @@ openstack endpoint create $CONGRESS_SERVICE \ --internalurl http://$CONGRESS_HOST:1789/ echo "Start the Congress service" -ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ubuntu@$CONGRESS_HOST "~/git/congress/bin/congress-server &>/dev/null &" +ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@$CONGRESS_HOST "~/git/congress/bin/congress-server &>/dev/null &" echo "Wait 30 seconds for Congress service to startup" sleep 30 @@ -162,7 +165,7 @@ openstack congress datasource create keystone "keystone" \ --config auth_url=http://$KEYSTONE_HOST:5000/v2.0 echo "Install tox test dependencies" -sudo apt-get install -y libffi-dev libssl-dev +sudo yum install -y libffi-devel openssl-devel echo "Run Congress tox Tests" cd ~/git/congress diff --git a/components/congress/install/bash/centos/install_congress_2.sh b/components/congress/install/bash/centos/install_congress_2.sh index 588c780..e98ca9b 100644 --- a/components/congress/install/bash/centos/install_congress_2.sh +++ b/components/congress/install/bash/centos/install_congress_2.sh @@ -31,22 +31,13 @@ echo "install pip" sudo yum install python-pip -y echo "install java" -sudo yum install default-jre -y +# sudo yum install default-jre -y # No package default-jre available. echo "install other dependencies" -sudo yum install apg git gcc python-dev libxml2 libxslt1-dev libzip-dev -y -# No package python-dev available. -# No package libxslt1-dev available. -# No package libzip-dev available. +sudo yum install apg git gcc libxml2 python-devel libzip-devel libxslt-devel -y sudo pip install --upgrade pip virtualenv setuptools pbr tox -echo "set mysql root user password and install mysql" -export MYSQL_PASSWORD=$(/usr/bin/apg -n 1 -m 16 -c cl_seed) -sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password '$MYSQL_PASSWORD -sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password '$MYSQL_PASSWORD -sudo -E yum -q -y install mysql-server python-mysqldb - echo "Clone congress" mkdir ~/git cd ~/git @@ -60,17 +51,15 @@ source bin/activate echo "Setup Congress" sudo mkdir -p /etc/congress -sudo chown ubuntu /etc/congress +sudo chown heat-admin /etc/congress mkdir -p /etc/congress/snapshot sudo mkdir /var/log/congress -sudo chown ubuntu /var/log/congress +sudo chown heat-admin /var/log/congress cp etc/api-paste.ini /etc/congress cp etc/policy.json /etc/congress echo "install requirements.txt and tox dependencies (detected by errors during 'tox -egenconfig')" -sudo yum install libffi-dev -y -sudo yum install openssl -y -sudo yum install libssl-dev -y +sudo yum install libffi-devel openssl openssl-devel -y echo "install dependencies of Congress" cd ~/git/congress @@ -97,16 +86,15 @@ sed -i -- 's/#auth_protocol = https/auth_protocol = http/g' etc/congress.conf.sa sed -i -- 's/#admin_tenant_name = admin/admin_tenant_name = admin/g' etc/congress.conf.sample sed -i -- 's/#admin_user = <None>/admin_user = congress/g' etc/congress.conf.sample sed -i -- 's/#admin_password = <None>/admin_password = congress/g' etc/congress.conf.sample -sed -i -- 's/#connection = <None>/connection = mysql:\/\/ubuntu:'$MYSQL_PASSWORD'@localhost:3306\/congress/g' etc/congress.conf.sample +sed -i -- 's/#connection = <None>/connection = mysql:\/\/congress@localhost:3306\/congress/g' etc/congress.conf.sample echo "copy congress.conf.sample to /etc/congress" cp etc/congress.conf.sample /etc/congress/congress.conf echo "create congress database" -sudo mysql --user=root --password=$MYSQL_PASSWORD -e "CREATE DATABASE congress; GRANT ALL PRIVILEGES ON congress.* TO 'ubuntu@localhost' IDENTIFIED BY '"$MYSQL_PASSWORD"'; GRANT ALL PRIVILEGES ON congress.* TO 'ubuntu'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"';" +sudo mysql -e "CREATE DATABASE congress; GRANT ALL PRIVILEGES ON congress.* TO 'congress';" echo "install congress-db-manage dependencies (detected by errors)" -sudo yum build-dep python-mysqldb -y bin/pip install MySQL-python echo "create database schema" @@ -122,7 +110,7 @@ git checkout stable/liberty function _congress_setup_horizon { local HORIZON_DIR="/usr/share/openstack-dashboard" - local CONGRESS_HORIZON_DIR="/home/ubuntu/git/congress/contrib/horizon" + local CONGRESS_HORIZON_DIR="/home/heat-admin/git/congress/contrib/horizon" sudo cp -r $CONGRESS_HORIZON_DIR/datasources $HORIZON_DIR/openstack_dashboard/dashboards/admin/ sudo cp -r $CONGRESS_HORIZON_DIR/policies $HORIZON_DIR/openstack_dashboard/dashboards/admin/ sudo cp -r $CONGRESS_HORIZON_DIR/static $HORIZON_DIR/openstack_dashboard/dashboards/admin/ |