diff options
Diffstat (limited to 'ci/deploy.sh')
-rwxr-xr-x | ci/deploy.sh | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh index a3b17baf..b99a5693 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -37,9 +37,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 VM_COMPUTES=2 @@ -52,6 +54,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_") @@ -108,7 +115,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 -f $NETSETS -i $net_isolation_enabled); then echo -e "${blue}${output}${reset}" eval "$output" else @@ -120,7 +127,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 @@ -660,12 +667,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 -t $CONFIG/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 -t $CONFIG/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 @@ -1053,15 +1060,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." @@ -1084,11 +1089,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" @@ -1108,11 +1108,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" @@ -1202,12 +1197,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 |