summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xci/clean.sh4
-rwxr-xr-xci/deploy.sh49
-rwxr-xr-xci/util.sh4
-rw-r--r--lib/common-functions.sh2
4 files changed, 26 insertions, 33 deletions
diff --git a/ci/clean.sh b/ci/clean.sh
index 368ce8bc..e5b2f91c 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -14,9 +14,11 @@
# Use default if no param passed
CONFIG=${CONFIG:-'/var/opt/opnfv'}
+RESOURCES=${RESOURCES:-"$CONFIG/images"}
+LIB=${LIB:-"$CONFIG/lib"}
##LIBRARIES
-source $CONFIG/lib/common-functions.sh
+source $LIB/common-functions.sh
vm_index=4
ovs_bridges="br-admin br-private br-public br-storage"
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 6b38c336..025ebf30 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -38,9 +38,11 @@ declare -A NET_MAP
SSH_OPTIONS=(-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o LogLevel=error)
DEPLOY_OPTIONS=""
-RESOURCES=${RESOURCES:-'/var/opt/opnfv/images'}
CONFIG=${CONFIG:-'/var/opt/opnfv'}
+RESOURCES=${RESOURCES:-"$CONFIG/images"}
+LIB=${LIB:-"$CONFIG/lib"}
OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_network"
+
VM_CPUS=4
VM_RAM=8
# Netmap used to map networks to OVS bridge names
@@ -51,6 +53,11 @@ NET_MAP['storage_network']="br-storage"
ext_net_type="interface"
ip_address_family=4
+# Libraries
+source $LIB/common-functions.sh
+source $LIB/utility-functions.sh
+source $LIB/installer/onos/onos_gw_mac_update.sh
+
##FUNCTIONS
##translates yaml into variables
##params: filename, prefix (ex. "config_")
@@ -107,7 +114,7 @@ parse_setting_value() {
##parses network settings yaml into globals
parse_network_settings() {
local output
- if output=$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py parse_net_settings -n $NETSETS -i $net_isolation_enabled); then
+ if output=$(python3.4 -B $LIB/python/apex-python-utils.py parse_net_settings -n $NETSETS -i $net_isolation_enabled); then
echo -e "${blue}${output}${reset}"
eval "$output"
else
@@ -119,7 +126,7 @@ parse_network_settings() {
##parses deploy settings yaml into globals
parse_deploy_settings() {
local output
- if output=$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py parse-deploy-settings -f $DEPLOY_SETTINGS_FILE); then
+ if output=$(python3.4 -B $LIB/python/apex-python-utils.py parse-deploy-settings -f $DEPLOY_SETTINGS_FILE); then
echo -e "${blue}${output}${reset}"
eval "$output"
else
@@ -649,12 +656,12 @@ function configure_undercloud {
echo -e "${blue}Network Environment set for Deployment: ${reset}"
cat $CONFIG/network-environment.yaml
scp ${SSH_OPTIONS[@]} $CONFIG/network-environment.yaml "stack@$UNDERCLOUD":
- if ! controller_nic_template=$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py nic_template -d $CONFIG -f nics-controller.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family); then
+ if ! controller_nic_template=$(python3.4 -B $LIB/python/apex-python-utils.py nic_template -d $CONFIG -f nics-controller.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family); then
echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}"
exit 1
fi
- if ! compute_nic_template=$(python3.4 -B $CONFIG/lib/python/apex-python-utils.py nic_template -d $CONFIG -f nics-compute.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family); then
+ if ! compute_nic_template=$(python3.4 -B $LIB/python/apex-python-utils.py nic_template -d $CONFIG -f nics-compute.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family); then
echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}"
exit 1
fi
@@ -1042,15 +1049,13 @@ EOI
display_usage() {
echo -e "Usage:\n$0 [arguments] \n"
- echo -e " -c|--config : Directory to configuration files. Optional. Defaults to /var/opt/opnfv/ \n"
- echo -e " -d|--deploy-settings : Full path to deploy settings yaml file. Optional. Defaults to null \n"
- echo -e " -i|--inventory : Full path to inventory yaml file. Required only for baremetal \n"
- echo -e " -n|--net-settings : Full path to network settings file. Optional. \n"
- echo -e " -p|--ping-site : site to use to verify IP connectivity. Optional. Defaults to 8.8.8.8 \n"
- echo -e " -r|--resources : Directory to deployment resources. Optional. Defaults to /var/opt/opnfv/stack \n"
- echo -e " -v|--virtual : Virtualize overcloud nodes instead of using baremetal. \n"
- echo -e " --no-ha : disable High Availability deployment scheme, this assumes a single controller and single compute node \n"
- echo -e " --flat : disable Network Isolation and use a single flat network for the underlay network.\n"
+ echo -e " -d|--deploy-settings : Full path to deploy settings yaml file. Optional. Defaults to null"
+ echo -e " -i|--inventory : Full path to inventory yaml file. Required only for baremetal"
+ echo -e " -n|--net-settings : Full path to network settings file. Optional."
+ echo -e " -p|--ping-site : site to use to verify IP connectivity. Optional. Defaults to 8.8.8.8"
+ echo -e " -v|--virtual : Virtualize overcloud nodes instead of using baremetal."
+ echo -e " --no-ha : disable High Availability deployment scheme, this assumes a single controller and single compute node"
+ echo -e " --flat : disable Network Isolation and use a single flat network for the underlay network."
echo -e " --no-post-config : disable Post Install configuration."
echo -e " --debug : enable debug output."
echo -e " --interactive : enable interactive deployment mode which requires user to confirm steps of deployment."
@@ -1073,11 +1078,6 @@ parse_cmdline() {
display_usage
exit 0
;;
- -c|--config)
- CONFIG=$2
- echo "Deployment Configuration Directory Overridden to: $2"
- shift 2
- ;;
-d|--deploy-settings)
DEPLOY_SETTINGS_FILE=$2
echo "Deployment Configuration file: $2"
@@ -1097,11 +1097,6 @@ parse_cmdline() {
echo "Using $2 as the ping site"
shift 2
;;
- -r|--resources)
- RESOURCES=$2
- echo "Deployment Resources Directory Overridden to: $2"
- shift 2
- ;;
-v|--virtual)
virtual="TRUE"
echo "Executing a Virtual Deployment"
@@ -1187,12 +1182,6 @@ parse_cmdline() {
post_config="FALSE"
fi
- ##LIBRARIES
- # Do this after cli parse so that $CONFIG is set properly
- source $CONFIG/lib/common-functions.sh
- source $CONFIG/lib/utility-functions.sh
- source $CONFIG/lib/installer/onos/onos_gw_mac_update.sh
-
}
##END FUNCTIONS
diff --git a/ci/util.sh b/ci/util.sh
index 67748c0b..b262c203 100755
--- a/ci/util.sh
+++ b/ci/util.sh
@@ -3,9 +3,11 @@
# @author Tim Rozet (trozet@redhat.com)
CONFIG=${CONFIG:-'/var/opt/opnfv'}
+RESOURCES=${RESOURCES:-"$CONFIG/images"}
+LIB=${LIB:-"$CONFIG/lib"}
VALID_CMDS="undercloud debug-stack -h --help"
-source $CONFIG/lib/utility-functions.sh
+source $LIB/utility-functions.sh
resolve_cmd() {
local given=$1
diff --git a/lib/common-functions.sh b/lib/common-functions.sh
index d01f7918..2e401b75 100644
--- a/lib/common-functions.sh
+++ b/lib/common-functions.sh
@@ -18,7 +18,7 @@ function find_ip {
return 1
fi
- python3.4 -B $CONFIG/lib/python/apex-python-utils.py find_ip -i $1
+ python3.4 -B $LIB/python/apex-python-utils.py find_ip -i $1
}
##attach interface to OVS and set the network config correctly