summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
7eb710c)
- removing the -r and -c parameters
- relying on ENV vars for non-system locations
- abstracting the apex-python-utils to a var
Change-Id: I7ff1ca8b741c890647aee029c57e8342f0b5cb07
Signed-off-by: Dan Radez <dradez@redhat.com>
# Use default if no param passed
CONFIG=${CONFIG:-'/var/opt/opnfv'}
# Use default if no param passed
CONFIG=${CONFIG:-'/var/opt/opnfv'}
+RESOURCES=${RESOURCES:-"$CONFIG/images"}
+LIB=${LIB:-"$CONFIG/lib"}
-source $CONFIG/lib/common-functions.sh
+source $LIB/common-functions.sh
vm_index=4
ovs_bridges="br-admin br-private br-public br-storage"
vm_index=4
ovs_bridges="br-admin br-private br-public br-storage"
SSH_OPTIONS=(-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o LogLevel=error)
DEPLOY_OPTIONS=""
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'}
CONFIG=${CONFIG:-'/var/opt/opnfv'}
+RESOURCES=${RESOURCES:-"$CONFIG/images"}
+LIB=${LIB:-"$CONFIG/lib"}
OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_network"
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
VM_CPUS=4
VM_RAM=8
# Netmap used to map networks to OVS bridge names
ext_net_type="interface"
ip_address_family=4
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_")
##FUNCTIONS
##translates yaml into variables
##params: filename, prefix (ex. "config_")
##parses network settings yaml into globals
parse_network_settings() {
local output
##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
echo -e "${blue}${output}${reset}"
eval "$output"
else
##parses deploy settings yaml into globals
parse_deploy_settings() {
local output
##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
echo -e "${blue}${output}${reset}"
eval "$output"
else
echo -e "${blue}Network Environment set for Deployment: ${reset}"
cat $CONFIG/network-environment.yaml
scp ${SSH_OPTIONS[@]} $CONFIG/network-environment.yaml "stack@$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
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
echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}"
exit 1
fi
display_usage() {
echo -e "Usage:\n$0 [arguments] \n"
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."
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."
- -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"
-d|--deploy-settings)
DEPLOY_SETTINGS_FILE=$2
echo "Deployment Configuration file: $2"
echo "Using $2 as the ping site"
shift 2
;;
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"
-v|--virtual)
virtual="TRUE"
echo "Executing a Virtual Deployment"
- ##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
-
# @author Tim Rozet (trozet@redhat.com)
CONFIG=${CONFIG:-'/var/opt/opnfv'}
# @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"
VALID_CMDS="undercloud debug-stack -h --help"
-source $CONFIG/lib/utility-functions.sh
+source $LIB/utility-functions.sh
resolve_cmd() {
local given=$1
resolve_cmd() {
local given=$1
- 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
}
##attach interface to OVS and set the network config correctly