diff options
Diffstat (limited to 'ci/deploy.sh')
-rwxr-xr-x | ci/deploy.sh | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh index 91663dfc..ee0ea3ba 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -179,8 +179,19 @@ parse_cmdline() { exit 1 fi - if [[ -n "$virtual" && -n "$INVENTORY_FILE" ]]; then - echo -e "${red}ERROR: You should not specify an inventory with virtual deployments${reset}" + # inventory file usage validation + if [[ -n "$virtual" ]]; then + if [[ -n "$INVENTORY_FILE" ]]; then + echo -e "${red}ERROR: You should not specify an inventory file with virtual deployments${reset}" + exit 1 + else + INVENTORY_FILE='/tmp/inventory-virt.yaml' + fi + elif [[ -z "$INVENTORY_FILE" ]]; then + echo -e "${red}ERROR: You must specify an inventory file for baremetal deployments! Exiting...${reset}" + exit 1 + elif [[ ! -f "$INVENTORY_FILE" ]]; then + echo -e "{$red}ERROR: Inventory File: ${INVENTORY_FILE} does not exist! Exiting...${reset}" exit 1 fi @@ -194,16 +205,6 @@ parse_cmdline() { exit 1 fi - if [[ ! -z "$INVENTORY_FILE" && ! -f "$INVENTORY_FILE" ]]; then - echo -e "{$red}ERROR: Inventory File: ${INVENTORY_FILE} does not exist! Exiting...${reset}" - exit 1 - fi - - if [[ -z "$virtual" && -z "$INVENTORY_FILE" ]]; then - echo -e "${red}ERROR: You must specify an inventory file for baremetal deployments! Exiting...${reset}" - exit 1 - fi - if [[ "$net_isolation_enabled" == "FALSE" && "$post_config" == "TRUE" ]]; then echo -e "${blue}INFO: Post Install Configuration will be skipped. It is not supported with --flat${reset}" post_config="FALSE" @@ -223,12 +224,17 @@ main() { echo -e "${red}Dependency Validation Failed, Exiting.${reset}" exit 1 fi + #Correct the time on the server prior to launching any VMs + if ntpdate $ntp_server; then + hwclock --systohc + else + echo "${blue}WARNING: ntpdate failed to update the time on the server. ${reset}" + fi setup_undercloud_vm if [ "$virtual" == "TRUE" ]; then setup_virtual_baremetal $VM_CPUS $VM_RAM - elif [ -n "$INVENTORY_FILE" ]; then - parse_inventory_file fi + parse_inventory_file configure_undercloud overcloud_deploy if [ "$post_config" == "TRUE" ]; then |