diff options
Diffstat (limited to 'lib/post-install-functions.sh')
-rwxr-xr-x | lib/post-install-functions.sh | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/lib/post-install-functions.sh b/lib/post-install-functions.sh index 604eb70d..51287c4b 100755 --- a/lib/post-install-functions.sh +++ b/lib/post-install-functions.sh @@ -13,7 +13,10 @@ function configure_post_install { local opnfv_attach_networks ovs_ip ip_range net_cidr tmp_ip af external_network_ipv6 external_network_ipv6=False - opnfv_attach_networks="admin external" + opnfv_attach_networks="admin" + if [[ $enabled_network_list =~ "external" ]]; then + opnfv_attach_networks+=' external' + fi echo -e "${blue}INFO: Post Install Configuration Running...${reset}" @@ -39,7 +42,7 @@ EOI else echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} missing IP, will configure${reset}" # use last IP of allocation pool - eval "ip_range=\${${network}_usable_ip_range}" + eval "ip_range=\${${network}_overcloud_ip_range}" ovs_ip=${ip_range##*,} eval "net_cidr=\${${network}_cidr}" if [[ $ovs_ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then @@ -90,25 +93,28 @@ echo "Configuring Neutron external network" if [[ -n "$external_nic_mapping_compute_vlan" && "$external_nic_mapping_compute_vlan" != 'native' ]]; then neutron net-create external --router:external=True --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') --provider:network_type vlan --provider:segmentation_id ${external_nic_mapping_compute_vlan} --provider:physical_network datacentre else - neutron net-create external --router:external=True --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') + neutron net-create external --router:external=True --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') --provider:network_type flat --provider:physical_network datacentre fi if [ "$external_network_ipv6" == "True" ]; then neutron subnet-create --name external-net --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') external --ip_version 6 --ipv6_ra_mode slaac --ipv6_address_mode slaac --gateway ${external_gateway} --allocation-pool start=${external_floating_ip_range%%,*},end=${external_floating_ip_range##*,} ${external_cidr} -else +elif [[ "$enabled_network_list" =~ "external" ]]; then neutron subnet-create --name external-net --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') --disable-dhcp external --gateway ${external_gateway} --allocation-pool start=${external_floating_ip_range%%,*},end=${external_floating_ip_range##*,} ${external_cidr} +else + # we re-use the introspection range for floating ips with single admin network + neutron subnet-create --name external-net --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') --disable-dhcp external --gateway ${admin_gateway} --allocation-pool start=${admin_introspection_range%%,*},end=${admin_introspection_range##*,} ${admin_cidr} fi echo "Removing sahara endpoint and service" sahara_service_id=\$(openstack service list | grep sahara | cut -d ' ' -f 2) sahara_endpoint_id=\$(openstack endpoint list | grep sahara | cut -d ' ' -f 2) -openstack endpoint delete \$sahara_endpoint_id -openstack service delete \$sahara_service_id +[[ -n "\$sahara_endpoint_id" ]] && openstack endpoint delete \$sahara_endpoint_id +[[ -n "\$sahara_service_id" ]] && openstack service delete \$sahara_service_id echo "Removing swift endpoint and service" swift_service_id=\$(openstack service list | grep swift | cut -d ' ' -f 2) swift_endpoint_id=\$(openstack endpoint list | grep swift | cut -d ' ' -f 2) -openstack endpoint delete \$swift_endpoint_id -openstack service delete \$swift_service_id +[[ -n "\$swift_endpoint_id" ]] && openstack endpoint delete \$swift_endpoint_id +[[ -n "\$swift_service_id" ]] && openstack service delete \$swift_service_id if [ "${deploy_options_array['dataplane']}" == 'fdio' ] || [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then for flavor in \$(openstack flavor list -c Name -f value); do @@ -117,7 +123,9 @@ if [ "${deploy_options_array['dataplane']}" == 'fdio' ] || [ "${deploy_options_a done fi -if [ "${deploy_options_array['congress']}" == 'True' ]; then +# TODO: Change this back to True once everything is back in +# place with tht and puppet-congress for deployment +if [ "${deploy_options_array['congress']}" == 'NeverTrue' ]; then ds_configs="--config username=\$OS_USERNAME --config tenant_name=\$OS_TENANT_NAME --config password=\$OS_PASSWORD @@ -145,8 +153,13 @@ EOI # for virtual, we NAT external network through Undercloud # same goes for baremetal if only jumphost has external connectivity if [ "$virtual" == "TRUE" ] || ! test_overcloud_connectivity && [ "$external_network_ipv6" != "True" ]; then - if ! configure_undercloud_nat ${external_cidr}; then - echo -e "${red}ERROR: Unable to NAT undercloud with external net: ${external_cidr}${reset}" + if [[ "$enabled_network_list" =~ "external" ]]; then + nat_cidr=${external_cidr} + else + nat_cidr=${admin_cidr} + fi + if ! configure_undercloud_nat ${nat_cidr}; then + echo -e "${red}ERROR: Unable to NAT undercloud with external net: ${nat_cidr}${reset}" exit 1 else echo -e "${blue}INFO: Undercloud VM has been setup to NAT Overcloud external network${reset}" @@ -208,7 +221,7 @@ done # Print out the undercloud IP and dashboard URL source stackrc echo "Undercloud IP: $UNDERCLOUD, please connect by doing 'opnfv-util undercloud'" -echo "Overcloud dashboard available at http://\$(openstack stack output show overcloud PublicVip | sed 's/"//g')/dashboard" +echo "Overcloud dashboard available at http://\$(openstack stack output show overcloud PublicVip -f json | jq -r .output_value)/dashboard" EOI if [[ "$ha_enabled" == 'True' ]]; then |