From 453d58c308e03511df2d51f7bac95b91e1789fbf Mon Sep 17 00:00:00 2001 From: davidplunkett Date: Sat, 16 Nov 2019 01:08:51 +0000 Subject: [PATCH] generate openrc and update_software.sh for site Create a default openrc file for each site to use with openstack cli. Create update_software script with correct OS_AUTH_URL to simplify deploying changes to the site using shipyard and armada. Signed-off-by: davidplunkett Change-Id: Id3f05f3312e49541c2f10ec3b13da573eccc7882 --- tools/1prom-gen.sh | 8 ++++++++ tools/2genesis.sh | 2 ++ tools/openrc | 1 + tools/update_software.sh | 26 ++++++++++++++++++++------ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/tools/1prom-gen.sh b/tools/1prom-gen.sh index 4284af2..dfac5e6 100755 --- a/tools/1prom-gen.sh +++ b/tools/1prom-gen.sh @@ -123,6 +123,7 @@ echo "# Copying scripts to $AIRSHIP_TREASUREMAP/${SITE}_bundle" REGION_NAME=$SITE DEPLOY_SCRIPT=$AIRSHIP_TREASUREMAP/${SITE}_bundle/deploy_site.sh + UPDATE_SCRIPT=$AIRSHIP_TREASUREMAP/${SITE}_bundle/update_software.sh IPTABLES_SCRIPT=$AIRSHIP_TREASUREMAP/${SITE}_bundle/update_iptables.sh cp $YAML_BUILDS/tools/deploy_site.sh $AIRSHIP_TREASUREMAP/${SITE}_bundle @@ -132,11 +133,18 @@ echo "# Copying scripts to $AIRSHIP_TREASUREMAP/${SITE}_bundle" sed -i -e "s|MAAS_URL=|MAAS_URL=${MAAS_URL}|g" $DEPLOY_SCRIPT sed -i -e "s|AIRFLOW_URL=|AIRFLOW_URL=${AIRFLOW_URL}|g" $DEPLOY_SCRIPT + cp $YAML_BUILDS/tools/update_software.sh $AIRSHIP_TREASUREMAP/${SITE}_bundle + sed -i -e "s|OS_AUTH_URL=|OS_AUTH_URL=\"${AUTH_URL}\"|g" $UPDATE_SCRIPT + sed -i -e "s/OS_PASSWORD=/OS_PASSWORD=$SHIPYARD_PASSWORD/g" $UPDATE_SCRIPT + sed -i -e "s/REGION_NAME=/REGION_NAME=$REGION_NAME/g" $UPDATE_SCRIPT + cp $YAML_BUILDS/tools/update_iptables.sh $AIRSHIP_TREASUREMAP/${SITE}_bundle sed -i -e "s,HOST_INTERFACE=,HOST_INTERFACE=$HOST_INTERFACE,g" $IPTABLES_SCRIPT sed -i -e "s,PXE_INTERFACE=,PXE_INTERFACE=$PXE_INTERFACE,g" $IPTABLES_SCRIPT cp $YAML_BUILDS/tools/cleanup.sh $AIRSHIP_TREASUREMAP/${SITE}_bundle + + cp $YAML_BUILDS/tools/openrc $AIRSHIP_TREASUREMAP/${SITE}_bundle ) ( diff --git a/tools/2genesis.sh b/tools/2genesis.sh index 3c2888b..d602b93 100755 --- a/tools/2genesis.sh +++ b/tools/2genesis.sh @@ -66,6 +66,8 @@ ssh $GENESIS_HOST << EOF cp /tmp/promenade-bundle-$SITE.tar . tar -xmf promenade-bundle-$SITE.tar mv configs/promenade-bundle/deploy_site.sh . + mv configs/promenade-bundle/update_software.sh . + mv configs/promenade-bundle/openrc . EOF echo "# Waiting for BIOS updates to finish on master and worker nodes" diff --git a/tools/openrc b/tools/openrc index 7602b05..0ecaf35 100644 --- a/tools/openrc +++ b/tools/openrc @@ -6,3 +6,4 @@ OS_REGION_NAME=RegionOne OS_USERNAME=admin OS_IDENTITY_API_VERSION=3 OS_PASSWORD=password123 + diff --git a/tools/update_software.sh b/tools/update_software.sh index 52d03bb..537512b 100755 --- a/tools/update_software.sh +++ b/tools/update_software.sh @@ -1,4 +1,19 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. # +# # +# You may obtain a copy of the License at # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +############################################################################## set -x TIMESTAMP=$(date +"%Y%m%d%H%M") @@ -8,20 +23,19 @@ exec 1> >(tee -a $LOGFILE) exec 2>&1 # Site specific variables -export OS_AUTH_URL="http://iam-sw.vran.k2.ericsson.se:80/v3" +export OS_AUTH_URL= export OS_USERNAME=shipyard -export OS_PASSWORD=password123 -REGION_NAME=MTN3 +export OS_PASSWORD= +REGION_NAME= tools/airship shipyard create configdocs ${REGION_NAME} --directory=/target/configs/promenade tools/airship shipyard commit configdocs -tools/airship shipyard create action update_software +SHIPYARD_ACTION=$(tools/airship shipyard create action update_software | awk '/update_software/ {print $2};') tools/airship shipyard get actions # Monitor the workflow -#SHIPYARD_ACTION=$(tools/airship shipyard get actions | awk '/update_software/ {print $2};') -#tools/airship shipyard describe $SHIPYARD_ACTION +tools/airship shipyard describe $SHIPYARD_ACTION -- 2.16.6