# Devstack settings

# Each service you enable has the following meaning:
#
# ovsvapp-server - Add this config flag for ML2 changes in OpenStack
#                  Controller for Neutron.
#
# ovsvapp-compute - Add this config flag for Nova VCDriver changes in
#                   OpenStack ComputeNode for OVSvApp.
#
# ovsvapp-agent - Add this config flag for OVSvApp L2 Agent in OVSvApp VM.

# An example of enabling all-in-one OVSvApp solution is below.
# enable_service ovsvapp-server ovsvapp-compute ovsvapp-agent

# This can be overridden in the local.conf file
OVSVAPP_MODE=${OVSVAPP_MODE:-allinone}

# OVSVAPP_MODE is used to configure how devstack works with OVSvApp solution.
# You can configure this in following ways:
#
# OVSVAPP_MODE=allinone
# Use this mode if you want to run OVSvApp solution in Single Node deployment.
#
# OVSVAPP_MODE=server
# Use this mode for the controller node of a multi-node devstack install.
#
# OVSVAPP_MODE=compute
# Use this mode for the compute node of a multi-node devstack install.
#
# OVSVAPP_MODE=agent
# Use this mode for the OVSvApp VM of a multi-node devstack install.
#
# OVSVAPP_MODE=manual
# You're on your own here, and are enabling services outside the scope of
# the OVSVAPP_MODE variable.


# Set in local.conf for OVSvApp Solution
# --------

# Provide IP address for vCenter.
OVSVAPP_VCENTER_IP=${OVSVAPP_VCENTER_IP:-None}

# Provide vCenter Credentials.
OVSVAPP_VCENTER_USERNAME=${OVSVAPP_VCENTER_USERNAME:-None}
OVSVAPP_VCENTER_PASSWORD=${OVSVAPP_VCENTER_PASSWORD:-None}

# vCenter server wsdl location.
OVSVAPP_WSDL_LOCATION=${OVSVAPP_WSDL_LOCATION:-https://${OVSVAPP_VCENTER_IP}:443/sdk/vimService.wsdl}

# Provide ESX host name or IP address where OVSvApp VM is hosted.
OVSVAPP_ESX_HOSTNAME=${OVSVAPP_ESX_HOSTNAME:-None}

# Provide Cluster to DVS/vDS mapping.
OVSVAPP_CLUSTER_DVS_MAPPING=${OVSVAPP_CLUSTER_DVS_MAPPING:-DatacenterName/host/ClusterName:vDSName}

# Provide the tenant network type (VLAN or VXLAN).
OVSVAPP_TENANT_NETWORK_TYPE=${OVSVAPP_TENANT_NETWORK_TYPE:-vlan}

# Provide the IP for VXLAN tunnel endpoint.
OVSVAPP_LOCAL_IP=${OVSVAPP_LOCAL_IP:-None}

# Provide Physical Bridge name.
OVSVAPP_PHYSICAL_BRIDGE=${OVSVAPP_PHYSICAL_BRIDGE:-br-ethx}

# Provide Physical Interface to add port to Physical Bridge.
OVSVAPP_PHYSICAL_INTERFACE=${OVSVAPP_PHYSICAL_INTERFACE:-ethx}

# Provide Trunk Interface.
OVSVAPP_TRUNK_INTERFACE=${OVSVAPP_TRUNK_INTERFACE:-ethy}

# Provide Physical Bridge Mappings.
OVSVAPP_BRIDGE_MAPPINGS=${OVSVAPP_BRIDGE_MAPPINGS:-physnet1:ethx}

# Provide Security Bridge Mapping.
OVSVAPP_SECURITY_BRIDGE_MAPPINGS=${OVSVAPP_SECURITY_BRIDGE_MAPPINGS:-br-sec:ethy}

# Provide Integration Bridge.
INTEGRATION_BRIDGE=${INTEGRATION_BRIDGE:-br-int}

# Provide Tunnel Bridge.
TUNNEL_BRIDGE=${TUNNEL_BRIDGE:-br-tun}

# Provide Security Bridge.
SECURITY_BRIDGE=${SECURITY_BRIDGE:-br-sec}

case $OVSVAPP_MODE in
    allinone)
        enable_service ovsvapp-server ovsvapp-compute ovsvapp-agent
        ;;
    server)
        enable_service ovsvapp-server
        ;;
    compute)
        enable_service ovsvapp-compute
        ;;
    agent)
        enable_service ovsvapp-agent
        ;;
    manual)
        echo "Manual mode: Enabling services explicitly."
        ;;
esac
