Don't create networks if neutron is not enabled

With the composable undercloud installer, it's possible to disable
services.  The extraconfig script assumes both, neutron and nova, are
installed and fails if they aren't.

This patch checks if those services are available before.

Change-Id: Idcc2b9809fcfa92649a0a1f45175ce417dc0e608
This commit is contained in:
Flavio Percoco 2017-06-07 13:45:37 +02:00
parent 1f4b13ca5f
commit d27c778e3c
1 changed files with 47 additions and 43 deletions

View File

@ -45,6 +45,7 @@ if ! grep "$(cat /root/.ssh/id_rsa.pub)" /root/.ssh/authorized_keys; then
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
fi
if [ "$(hiera neutron_api_enabled)" = "true" ]; then
PHYSICAL_NETWORK=ctlplane
ctlplane_id=$(openstack network list -f csv -c ID -c Name --quote none | tail -n +2 | grep ctlplane | cut -d, -f1)
@ -93,9 +94,12 @@ if [ "$net_create" -eq "1" ]; then
--host-route destination=169.254.169.254/32,gateway=$local_ip \
$NAMESERVER_ARG ctlplane
fi
fi
if [ "$(hiera nova_api_enabled)" = "true" ]; then
# Disable nova quotas
openstack quota set --cores -1 --instances -1 --ram -1 $(openstack project show admin | awk '$2=="id" {print $4}')
fi
# MISTRAL WORKFLOW CONFIGURATION
if [ "$(hiera mistral_api_enabled)" = "true" ]; then