@@ -1,28 +1,28 @@
# -*- mode: shell-script -*-
# Set up default directories
AKANDA_RUG _DIR = ${ AKANDA_RUG _DIR :- $DEST /akanda-rug }
AKAND A_CACHE_DIR = ${ AKAND A_CACHE_DIR :- /var/cache/akand a }
AKAND A_NEUTRON_DIR = ${ AKAND A_NEUTRON_DIR :- $DEST /akand a-neutron }
AKAND A_NEUTRON_REPO = ${ AKAND A_NEUTRON_REPO :- http : //github.com/openstack/akand a-neutron.git }
AKAND A_NEUTRON_BRANCH = ${ AKAND A_NEUTRON_BRANCH :- master }
ASTARA _DIR = ${ ASTARA _DIR :- $DEST /astara }
ASTAR A_CACHE_DIR = ${ ASTAR A_CACHE_DIR :- /var/cache/astar a }
ASTAR A_NEUTRON_DIR = ${ ASTAR A_NEUTRON_DIR :- $DEST /astar a-neutron }
ASTAR A_NEUTRON_REPO = ${ ASTAR A_NEUTRON_REPO :- http : //github.com/openstack/astar a-neutron.git }
ASTAR A_NEUTRON_BRANCH = ${ ASTAR A_NEUTRON_BRANCH :- master }
AKAND A_APPLIANCE_DIR = ${ AKAND A_APPLIANCE_DIR :- $DEST /akand a-appliance }
AKAND A_APPLIANCE_REPO = ${ AKAND A_APPLIANCE_REPO :- http : //github.com/openstack/akand a-appliance.git }
AKAND A_APPLIANCE_BRANCH = ${ AKAND A_APPLIANCE_BRANCH :- master }
ASTAR A_APPLIANCE_DIR = ${ ASTAR A_APPLIANCE_DIR :- $DEST /astar a-appliance }
ASTAR A_APPLIANCE_REPO = ${ ASTAR A_APPLIANCE_REPO :- http : //github.com/openstack/astar a-appliance.git }
ASTAR A_APPLIANCE_BRANCH = ${ ASTAR A_APPLIANCE_BRANCH :- master }
BUILD_AKAND A_APPLIANCE_IMAGE = ${ BUILD_AKAND A_APPLIANCE_IMAGE :- False }
AKAND A_DEV_APPLIANCE_URL = ${ AKAND A_DEV_APPLIANCE_URL :- http : //tarballs.openstack.org/akanda-appliance/images/akanda_appliance.qcow2 }
AKAND A_DEV_APPLIANCE_FILE = ${ AKAND A_DEV_APPLIANCE_FILE :- $TOP_DIR /files/akanda.qcow2 }
AKAND A_DEV_APPLIANCE_BUILD_PROXY = ${ AKAND A_DEV_APPLIANCE_BUILD_PROXY :- "" }
AKAND A_DEV_APPLIANCE_ENABLED_DRIVERS = "router,loadbalancer"
BUILD_ASTAR A_APPLIANCE_IMAGE = ${ BUILD_ASTAR A_APPLIANCE_IMAGE :- False }
ASTAR A_DEV_APPLIANCE_URL = ${ ASTAR A_DEV_APPLIANCE_URL :- http : //tarballs.openstack.org/akanda-appliance/images/akanda_appliance.qcow2 }
ASTAR A_DEV_APPLIANCE_FILE = ${ ASTAR A_DEV_APPLIANCE_FILE :- $TOP_DIR /files/akanda.qcow2 }
ASTAR A_DEV_APPLIANCE_BUILD_PROXY = ${ ASTAR A_DEV_APPLIANCE_BUILD_PROXY :- "" }
ASTAR A_DEV_APPLIANCE_ENABLED_DRIVERS = "router,loadbalancer"
AKAND A_HORIZON_DIR = ${ AKAND A_HORIZON_DIR :- $DEST /akand a-horizon }
AKAND A_HORIZON_REPO = ${ AKAND A_HORIZON_REPO :- http : //github.com/openstack/akand a-horizon }
AKAND A_HORIZON_BRANCH = ${ AKAND A_HORIZON_BRANCH :- master }
ASTAR A_HORIZON_DIR = ${ ASTAR A_HORIZON_DIR :- $DEST /astar a-horizon }
ASTAR A_HORIZON_REPO = ${ ASTAR A_HORIZON_REPO :- http : //github.com/openstack/astar a-horizon }
ASTAR A_HORIZON_BRANCH = ${ ASTAR A_HORIZON_BRANCH :- master }
AKAND A_CONF_DIR = /etc/akanda-rug
AKANDA_RUG _CONF = $AKAND A_CONF_DIR /rug .ini
ASTAR A_CONF_DIR = /etc/astara
ASTARA _CONF = $ASTAR A_CONF_DIR /orchestrator .ini
# Router instances will run as a specific Nova flavor. These values configure
# the specs of the flavor devstack will create.
@@ -32,117 +32,117 @@ ROUTER_INSTANCE_FLAVOR_DISK=${ROUTER_INSTANCE_FLAVOR_DISK:-5}
ROUTER_INSTANCE_FLAVOR_CPUS = ${ ROUTER_INSTANCE_FLAVOR_CPUS :- 1 }
PUBLIC_INTERFACE_DEFAULT = 'eth0'
AKANDA_RUG _MANAGEMENT_PREFIX = ${ RUG _MANGEMENT_PREFIX:- "fdca:3ba5:a17a:acda::/64" }
AKANDA_RUG _MANAGEMENT_PORT = ${ AKANDA_RUG _MANAGEMENT_PORT :- 5000 }
AKANDA_RUG _API_PORT = ${ AKANDA_RUG _API_PORT :- 44250 }
ASTARA _MANAGEMENT_PREFIX = ${ ASTARA _MANGEMENT_PREFIX:- "fdca:3ba5:a17a:acda::/64" }
ASTARA _MANAGEMENT_PORT = ${ ASTARA _MANAGEMENT_PORT :- 5000 }
ASTARA _API_PORT = ${ ASTARA _API_PORT :- 44250 }
HORIZON_LOCAL_SETTINGS = $HORIZON_DIR /openstack_dashboard/local/local_settings.py
# Path to public ssh key that will be added to the 'akanda' users authorized_keys
# within the appliance VM.
AKAND A_APPLIANCE_SSH_PUBLIC_KEY = ${ AKAND A_APPLIANCE_SSH_PUBLIC_KEY :- /home/ $STACK_USER /.ssh/id_rsa.pub }
ASTAR A_APPLIANCE_SSH_PUBLIC_KEY = ${ ASTAR A_APPLIANCE_SSH_PUBLIC_KEY :- /home/ $STACK_USER /.ssh/id_rsa.pub }
AKAND A_COORDINATION_ENABLED = ${ AKAND A_COORDINATION_ENABLED :- True }
AKAND A_COORDINATION_URL = ${ AKAND A_COORDINATION_URL :- memcached : //localhost : 11211 }
ASTAR A_COORDINATION_ENABLED = ${ ASTAR A_COORDINATION_ENABLED :- True }
ASTAR A_COORDINATION_URL = ${ ASTAR A_COORDINATION_URL :- memcached : //localhost : 11211 }
function colorize_logging {
# Add color to logging output - this is lifted from devstack's functions to colorize the non-standard
# akand a format
iniset $AKANDA_RUG _CONF DEFAULT logging_exception_prefix "%(color)s%(asctime)s.%(msecs)03d TRACE %(name)s [01; [00m"
iniset $AKANDA_RUG _CONF DEFAULT logging_debug_format_suffix " [00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d [00m"
iniset $AKANDA_RUG _CONF DEFAULT logging_default_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s:%(process)s:%(processName)s:%(threadName)s [ [00;36m-%(color)s] [01;35m%(color)s%(message)s [00m"
iniset $AKANDA_RUG _CONF DEFAULT logging_context_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s:%(process)s:%(processName)s:%(threadName)s [ [01;36m%(request_id)s [00;36m%(user)s %(tenant)s%(color)s] [01;35m%(color)s%(message)s [00m"
# astar a format
iniset $ASTARA _CONF DEFAULT logging_exception_prefix "%(color)s%(asctime)s.%(msecs)03d TRACE %(name)s [01; [00m"
iniset $ASTARA _CONF DEFAULT logging_debug_format_suffix " [00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d [00m"
iniset $ASTARA _CONF DEFAULT logging_default_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s:%(process)s:%(processName)s:%(threadName)s [ [00;36m-%(color)s] [01;35m%(color)s%(message)s [00m"
iniset $ASTARA _CONF DEFAULT logging_context_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s:%(process)s:%(processName)s:%(threadName)s [ [01;36m%(request_id)s [00;36m%(user)s %(tenant)s%(color)s] [01;35m%(color)s%(message)s [00m"
}
function configure_akand a( ) {
if [ [ ! -d $AKAND A_CONF_DIR ] ] ; then
sudo mkdir -p $AKAND A_CONF_DIR
function configure_astar a( ) {
if [ [ ! -d $ASTAR A_CONF_DIR ] ] ; then
sudo mkdir -p $ASTAR A_CONF_DIR
fi
sudo chown $STACK_USER $AKAND A_CONF_DIR
sudo chown $STACK_USER $ASTAR A_CONF_DIR
sudo mkdir -p $AKAND A_CACHE_DIR
sudo chown $STACK_USER $AKAND A_CACHE_DIR
sudo mkdir -p $ASTAR A_CACHE_DIR
sudo chown $STACK_USER $ASTAR A_CACHE_DIR
cp $AKANDA_RUG _DIR /etc/rug.ini $AKANDA_RUG _CONF
iniset $AKANDA_RUG _CONF DEFAULT verbose True
configure_auth_token_middleware $AKANDA_RUG _CONF $Q_ADMIN_USERNAME $AKAND A_CACHE_DIR
iniset $AKANDA_RUG _CONF DEFAULT amqp_url " amqp:// $RABBIT_USERID : $RABBIT_PASSWORD @ $RABBIT_HOST : $RABBIT_PORT / "
iniset $AKANDA_RUG _CONF DEFAULT control_exchange "neutron"
iniset $AKANDA_RUG _CONF DEFAULT boot_timeout "6000"
iniset $AKANDA_RUG _CONF DEFAULT num_worker_processes "2"
iniset $AKANDA_RUG _CONF DEFAULT num_worker_threads "2"
iniset $AKANDA_RUG _CONF DEFAULT reboot_error_threshold "2"
cp $ASTARA _DIR /etc/rug.ini $ASTARA _CONF
iniset $ASTARA _CONF DEFAULT verbose True
configure_auth_token_middleware $ASTARA _CONF $Q_ADMIN_USERNAME $ASTAR A_CACHE_DIR
iniset $ASTARA _CONF DEFAULT amqp_url " amqp:// $RABBIT_USERID : $RABBIT_PASSWORD @ $RABBIT_HOST : $RABBIT_PORT / "
iniset $ASTARA _CONF DEFAULT control_exchange "neutron"
iniset $ASTARA _CONF DEFAULT boot_timeout "6000"
iniset $ASTARA _CONF DEFAULT num_worker_processes "2"
iniset $ASTARA _CONF DEFAULT num_worker_threads "2"
iniset $ASTARA _CONF DEFAULT reboot_error_threshold "2"
iniset $AKANDA_RUG _CONF DEFAULT management_prefix $AKANDA_RUG _MANAGEMENT_PREFIX
iniset $AKANDA_RUG _CONF DEFAULT akand a_mgt_service_port $AKANDA_RUG _MANAGEMENT_PORT
iniset $AKANDA_RUG _CONF DEFAULT rug_api_port $AKANDA_RUG _API_PORT
iniset $ASTARA _CONF DEFAULT management_prefix $ASTARA _MANAGEMENT_PREFIX
iniset $ASTARA _CONF DEFAULT astar a_mgt_service_port $ASTARA _MANAGEMENT_PORT
iniset $ASTARA _CONF DEFAULT rug_api_port $ASTARA _API_PORT
if [ [ " $Q_AGENT " = = "linuxbridge" ] ] ; then
iniset $AKANDA_RUG _CONF DEFAULT interface_driver "akanda.rug.common.linux.interface.BridgeInterfaceDriver"
iniset $ASTARA _CONF DEFAULT interface_driver "akanda.rug.common.linux.interface.BridgeInterfaceDriver"
fi
iniset $AKANDA_RUG _CONF DEFAULT ssh_public_key $AKAND A_APPLIANCE_SSH_PUBLIC_KEY
iniset $ASTARA _CONF DEFAULT ssh_public_key $ASTAR A_APPLIANCE_SSH_PUBLIC_KEY
iniset $AKANDA_RUG _CONF database connection ` database_connection_url akand a`
iniset $ASTARA _CONF database connection ` database_connection_url astar a`
if [ " $LOG_COLOR " = = "True" ] && [ " $SYSLOG " = = "False" ] ; then
colorize_logging
fi
if [ [ " $AKAND A_COORDINATION_ENABLED " = = "True" ] ] ; then
iniset $AKANDA_RUG _CONF coordination enabled True
iniset $AKANDA_RUG _CONF coordination url $AKAND A_COORDINATION_URL
if [ [ " $ASTAR A_COORDINATION_ENABLED " = = "True" ] ] ; then
iniset $ASTARA _CONF coordination enabled True
iniset $ASTARA _CONF coordination url $ASTAR A_COORDINATION_URL
fi
}
function configure_akand a_nova( ) {
function configure_astar a_nova( ) {
iniset $NOVA_CONF DEFAULT service_neutron_metadata_proxy True
iniset $NOVA_CONF DEFAULT use_ipv6 True
}
function configure_akand a_neutron( ) {
function configure_astar a_neutron( ) {
iniset $NEUTRON_CONF DEFAULT core_plugin akanda.neutron.plugins.ml2_neutron_plugin.Ml2Plugin
iniset $NEUTRON_CONF DEFAULT service_plugins akanda.neutron.plugins.ml2_neutron_plugin.L3RouterPlugin
iniset $NEUTRON_CONF DEFAULT api_extensions_path $AKAND A_NEUTRON_DIR /akanda/neutron/extensions
iniset $NEUTRON_CONF DEFAULT api_extensions_path $ASTAR A_NEUTRON_DIR /akanda/neutron/extensions
# Use rpc as notification driver instead of the default no_ops driver
# We need the RUG to be able to get neutron's events notification like port.create.start/end
# or router.interface.start/end to make it able to boot akand a routers
# or router.interface.start/end to make it able to boot astar a routers
iniset $NEUTRON_CONF DEFAULT notification_driver "neutron.openstack.common.notifier.rpc_notifier"
}
function configure_akand a_horizon( ) {
function configure_astar a_horizon( ) {
# _horizon_config_set depends on this being set
local local_settings = $HORIZON_LOCAL_SETTINGS
for ext in $( ls $AKAND A_HORIZON_DIR /openstack_dashboard_extensions/*.py) ; do
for ext in $( ls $ASTAR A_HORIZON_DIR /openstack_dashboard_extensions/*.py) ; do
local ext_dest = $HORIZON_DIR /openstack_dashboard/local/enabled/$( basename $ext )
rm -rf $ext_dest
ln -s $ext $ext_dest
# if horizon is enabled, we assume lib/horizon has been sourced and _horizon_config_set
# is defined
_horizon_config_set $HORIZON_LOCAL_SETTINGS "" RUG_MANAGEMENT_PREFIX \" $AKANDA_RUG _MANAGEMENT_PREFIX \"
_horizon_config_set $HORIZON_LOCAL_SETTINGS "" RUG_API_PORT \" $AKANDA_RUG _API_PORT \"
_horizon_config_set $HORIZON_LOCAL_SETTINGS "" RUG_MANAGEMENT_PREFIX \" $ASTARA _MANAGEMENT_PREFIX \"
_horizon_config_set $HORIZON_LOCAL_SETTINGS "" RUG_API_PORT \" $ASTARA _API_PORT \"
done
}
function start_akand a_horizon( ) {
function start_astar a_horizon( ) {
restart_apache_server
}
function install_akand a( ) {
git_clone $AKAND A_NEUTRON_REPO $AKAND A_NEUTRON_DIR $AKAND A_NEUTRON_BRANCH
setup_develop $AKAND A_NEUTRON_DIR
setup_develop $AKANDA_RUG _DIR
function install_astar a( ) {
git_clone $ASTAR A_NEUTRON_REPO $ASTAR A_NEUTRON_DIR $ASTAR A_NEUTRON_BRANCH
setup_develop $ASTAR A_NEUTRON_DIR
setup_develop $ASTARA _DIR
# temp hack to add blessed durring devstack installs so that rug-ctl browse works out of the box
pip_install blessed
if [ " $BUILD_AKAND A_APPLIANCE_IMAGE " = = "True" ] ; then
git_clone $AKAND A_APPLIANCE_REPO $AKAND A_APPLIANCE_DIR $AKAND A_APPLIANCE_BRANCH
if [ " $BUILD_ASTAR A_APPLIANCE_IMAGE " = = "True" ] ; then
git_clone $ASTAR A_APPLIANCE_REPO $ASTAR A_APPLIANCE_DIR $ASTAR A_APPLIANCE_BRANCH
fi
if is_service_enabled horizon; then
git_clone $AKAND A_HORIZON_REPO $AKAND A_HORIZON_DIR $AKAND A_HORIZON_BRANCH
setup_develop $AKAND A_HORIZON_DIR
git_clone $ASTAR A_HORIZON_REPO $ASTAR A_HORIZON_DIR $ASTAR A_HORIZON_BRANCH
setup_develop $ASTAR A_HORIZON_DIR
fi
}
@@ -159,11 +159,11 @@ function _auth_args() {
echo " $auth_args "
}
function create_akand a_nova_flavor( ) {
nova flavor-create akand a $ROUTER_INSTANCE_FLAVOR_ID \
function create_astar a_nova_flavor( ) {
nova flavor-create astar a $ROUTER_INSTANCE_FLAVOR_ID \
$ROUTER_INSTANCE_FLAVOR_RAM $ROUTER_INSTANCE_FLAVOR_DISK \
$ROUTER_INSTANCE_FLAVOR_CPUS
iniset $AKANDA_RUG _CONF router instance_flavor $ROUTER_INSTANCE_FLAVOR_ID
iniset $ASTARA _CONF router instance_flavor $ROUTER_INSTANCE_FLAVOR_ID
}
function _remove_subnets( ) {
@@ -175,10 +175,10 @@ function _remove_subnets() {
neutron $auth_args subnet-delete $subnets || true )
}
function pre_start_akand a( ) {
function pre_start_astar a( ) {
# Create and init the database
recreate_database akand a
akanda-rug -dbsync --config-file $AKANDA_RUG _CONF upgrade
recreate_database astar a
astara -dbsync --config-file $ASTARA _CONF upgrade
local auth_args = " $( _auth_args $Q_ADMIN_USERNAME $SERVICE_PASSWORD $SERVICE_TENANT_NAME ) "
if ! neutron $auth_args net-show $PUBLIC_NETWORK_NAME ; then
neutron $auth_args net-create $PUBLIC_NETWORK_NAME --router:external
@@ -189,11 +189,11 @@ function pre_start_akanda() {
_remove_subnets $PUBLIC_NETWORK_NAME ; _remove_subnets $PUBLIC_NETWORK_NAME
typeset public_subnet_id = $( neutron $auth_args subnet-create --ip-version 4 $PUBLIC_NETWORK_NAME 172.16.77.0/24 | grep ' id ' | awk '{ print $4 }' )
iniset $AKANDA_RUG _CONF DEFAULT external_subnet_id $public_subnet_id
iniset $ASTARA _CONF DEFAULT external_subnet_id $public_subnet_id
neutron $auth_args subnet-create --ip-version 6 $PUBLIC_NETWORK_NAME fdee:9f85:83be::/48
# Point neutron-akand a at the subnet to use for floating IPs. This requires a neutron service restart (later) to take effect.
iniset $NEUTRON_CONF akand a floatingip_subnet $public_subnet_id
# Point neutron-astar a at the subnet to use for floating IPs. This requires a neutron service restart (later) to take effect.
iniset $NEUTRON_CONF astar a floatingip_subnet $public_subnet_id
# setup masq rule for public network
sudo iptables -t nat -A POSTROUTING -s 172.16.77.0/24 -o $PUBLIC_INTERFACE_DEFAULT -j MASQUERADE
@@ -201,64 +201,64 @@ function pre_start_akanda() {
neutron $auth_args net-show $PUBLIC_NETWORK_NAME | grep ' id ' | awk '{ print $4 }'
typeset public_network_id = $( neutron $auth_args net-show $PUBLIC_NETWORK_NAME | grep ' id ' | awk '{ print $4 }' )
iniset $AKANDA_RUG _CONF DEFAULT external_network_id $public_network_id
iniset $ASTARA _CONF DEFAULT external_network_id $public_network_id
neutron $auth_args net-create mgt
typeset mgt_network_id = $( neutron $auth_args net-show mgt | grep ' id ' | awk '{ print $4 }' )
iniset $AKANDA_RUG _CONF DEFAULT management_network_id $mgt_network_id
iniset $ASTARA _CONF DEFAULT management_network_id $mgt_network_id
# Remove the ipv6 subnet created automatically before adding our own.
_remove_subnets mgt
typeset mgt_subnet_id = $( neutron $auth_args subnet-create mgt fdca:3ba5:a17a:acda::/64 --ip-version= 6 --ipv6_address_mode= slaac --enable_dhcp | grep ' id ' | awk '{ print $4 }' )
iniset $AKANDA_RUG _CONF DEFAULT management_subnet_id $mgt_subnet_id
iniset $ASTARA _CONF DEFAULT management_subnet_id $mgt_subnet_id
# Remove the private network created by devstack
neutron $auth_args subnet-delete $PRIVATE_SUBNET_NAME
neutron $auth_args net-delete $PRIVATE_NETWORK_NAME
local akand a_dev_image_src = ""
local astar a_dev_image_src = ""
local lb_element = ""
if [ " $BUILD_AKAND A_APPLIANCE_IMAGE " = = "True" ] ; then
if [ " $BUILD_ASTAR A_APPLIANCE_IMAGE " = = "True" ] ; then
if [ [ $( type -P disk-image-create) = = "" ] ] ; then
pip_install "diskimage-builder<0.1.43"
fi
if [ [ " $AKAND A_DEV_APPLIANCE_ENABLED_DRIVERS " = ~ "loadbalancer" ] ] ; then
if [ [ " $ASTAR A_DEV_APPLIANCE_ENABLED_DRIVERS " = ~ "loadbalancer" ] ] ; then
# We can make this more configurable as we add more LB backends
lb_element = "nginx"
fi
# Point DIB at the devstack checkout of the akand a-appliance repo
DIB_REPOLOCATION_akand a = $AKAND A_APPLIANCE_DIR \
DIB_REPOREF_akand a = " $( cd $AKAND A_APPLIANCE_DIR && git rev-parse HEAD) " \
DIB_AKAND A_APPLIANCE_DEBUG_USER = $ADMIN_USERNAME \
DIB_AKAND A_APPLIANCE_DEBUG_PASSWORD = $ADMIN_PASSWORD \
DIB_AKAND A_ADVANCED_SERVICES = $AKAND A_DEV_APPLIANCE_ENABLED_DRIVERS \
http_proxy = $AKAND A_DEV_APPLIANCE_BUILD_PROXY \
ELEMENTS_PATH = $AKAND A_APPLIANCE_DIR /diskimage-builder/elements \
# Point DIB at the devstack checkout of the astar a-appliance repo
DIB_REPOLOCATION_astar a = $ASTAR A_APPLIANCE_DIR \
DIB_REPOREF_astar a = " $( cd $ASTAR A_APPLIANCE_DIR && git rev-parse HEAD) " \
DIB_ASTAR A_APPLIANCE_DEBUG_USER = $ADMIN_USERNAME \
DIB_ASTAR A_APPLIANCE_DEBUG_PASSWORD = $ADMIN_PASSWORD \
DIB_ASTAR A_ADVANCED_SERVICES = $ASTAR A_DEV_APPLIANCE_ENABLED_DRIVERS \
http_proxy = $ASTAR A_DEV_APPLIANCE_BUILD_PROXY \
ELEMENTS_PATH = $ASTAR A_APPLIANCE_DIR /diskimage-builder/elements \
DIB_RELEASE = jessie DIB_EXTLINUX = 1 disk-image-create debian vm akanda debug-user $lb_element \
-o $TOP_DIR /files/akand a
akand a_dev_image_src = $AKAND A_DEV_APPLIANCE_FILE
-o $TOP_DIR /files/astar a
astar a_dev_image_src = $ASTAR A_DEV_APPLIANCE_FILE
else
akand a_dev_image_src = $AKAND A_DEV_APPLIANCE_URL
astar a_dev_image_src = $ASTAR A_DEV_APPLIANCE_URL
fi
env
TOKEN = $( openstack token issue -c id -f value)
die_if_not_set $LINENO TOKEN "Keystone fail to get token"
upload_image $akand a_dev_image_src $TOKEN
upload_image $astar a_dev_image_src $TOKEN
local image_name = $( basename $akand a_dev_image_src | cut -d. -f1)
local image_name = $( basename $astar a_dev_image_src | cut -d. -f1)
typeset image_id = $( glance $auth_args image-list | grep $image_name | get_field 1)
die_if_not_set $LINENO image_id "Failed to find akand a image"
iniset $AKANDA_RUG _CONF router image_uuid $image_id
die_if_not_set $LINENO image_id "Failed to find astar a image"
iniset $ASTARA _CONF router image_uuid $image_id
# NOTE(adam_g): Currently we only support keystone v2 auth so we need to
# hardcode the auth url accordingly. See (LP: #1492654)
iniset $AKANDA_RUG _CONF DEFAULT auth_url $KEYSTONE_AUTH_PROTOCOL ://$KEYSTONE_AUTH_HOST :5000/v2.0
iniset $ASTARA _CONF DEFAULT auth_url $KEYSTONE_AUTH_PROTOCOL ://$KEYSTONE_AUTH_HOST :5000/v2.0
if is_service_enabled horizon; then
# _horizon_config_set depends on this being set
@@ -266,9 +266,9 @@ function pre_start_akanda() {
_horizon_config_set $HORIZON_LOCAL_SETTINGS "" ROUTER_IMAGE_UUID \" $image_id \"
fi
create_akand a_nova_flavor
create_astar a_nova_flavor
# Restart neutron so that `akand a.floatingip_subnet` is properly set
# Restart neutron so that `astar a.floatingip_subnet` is properly set
if [ [ " $USE_SCREEN " = = "True" ] ] ; then
screen_stop_service q-svc
else
@@ -278,15 +278,15 @@ function pre_start_akanda() {
sleep 10
}
function start_akanda_rug ( ) {
screen_it ak-rug " cd $AKANDA_RUG _DIR && akanda-rug-service --config-file $AKANDA_RUG _CONF "
function start_astara ( ) {
screen_it astara " cd $ASTARA _DIR && astara-orchestrator --config-file $ASTARA _CONF "
echo '************************************************************'
echo "Sleeping for a while to make sure the tap device gets set up"
echo '************************************************************'
sleep 10
}
function post_start_akand a( ) {
function post_start_astar a( ) {
echo "Creating demo user network and subnet"
local auth_args = " $( _auth_args demo $OS_PASSWORD demo) "
neutron $auth_args net-create thenet
@@ -296,10 +296,10 @@ function post_start_akanda() {
set_demo_tenant_sec_group_private_traffic
}
function stop_akanda_rug ( ) {
echo "Stopping the rug ..."
screen_stop_service ak-rug
stop_process ak-rug
function stop_astara ( ) {
echo "Stopping astara ..."
screen_stop_service astara
stop_process astara
}
function set_neutron_user_permission( ) {
@@ -323,45 +323,45 @@ function set_demo_tenant_sec_group_private_traffic() {
function check_prereqs( ) {
# Fail devstack as early as possible if system does not satisfy some known
# prerequisites
if [ ! -e " $AKAND A_APPLIANCE_SSH_PUBLIC_KEY " ] ; then
die $LINENO " Public SSH key not found at $AKAND A_APPLIANCE_SSH_PUBLIC_KEY . Please copy one there or " \
"set AKAND A_APPLIANCE_SSH_PUBLIC_KEY accordingly."
if [ ! -e " $ASTAR A_APPLIANCE_SSH_PUBLIC_KEY " ] ; then
die $LINENO " Public SSH key not found at $ASTAR A_APPLIANCE_SSH_PUBLIC_KEY . Please copy one there or " \
"set ASTAR A_APPLIANCE_SSH_PUBLIC_KEY accordingly."
fi
}
if is_service_enabled ak-rug ; then
if is_service_enabled astara ; then
if [ [ " $1 " = = "source" ] ] ; then
check_prereqs
elif [ [ " $1 " = = "stack" && " $2 " = = "install" ] ] ; then
echo_summary "Installing Akand a"
echo_summary "Installing Astar a"
set_neutron_user_permission
install_akand a
install_astar a
elif [ [ " $1 " = = "stack" && " $2 " = = "post-config" ] ] ; then
echo_summary "Installing Akand a"
configure_akand a
configure_akand a_nova
configure_akand a_neutron
echo_summary "Installing Astar a"
configure_astar a
configure_astar a_nova
configure_astar a_neutron
if is_service_enabled horizon; then
configure_akand a_horizon
configure_astar a_horizon
fi
cd $old_cwd
elif [ [ " $1 " = = "stack" && " $2 " = = "extra" ] ] ; then
echo_summary "Initializing Akand a"
pre_start_akand a
start_akanda_rug
echo_summary "Initializing Astar a"
pre_start_astar a
start_astara
if is_service_enabled horizon; then
start_akand a_horizon
start_astar a_horizon
fi
post_start_akand a
post_start_astar a
fi
if [ [ " $1 " = = "unstack" ] ] ; then
stop_akanda_rug
stop_astara
fi
if [ [ " $1 " = = "clean" ] ] ; then