Pass options from local.conf ot tobiko.conf
Change-Id: I4fb90736e53e0ed90370cdc150a4fe4fbc7fc947
This commit is contained in:
@@ -2,32 +2,34 @@
|
|||||||
TOBIKO_PLUGIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
TOBIKO_PLUGIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
|
||||||
|
|
||||||
function tobiko_install {
|
function install_tobiko {
|
||||||
echo_summary "Installing tobiko-plugin"
|
echo_summary "Installing tobiko-plugin"
|
||||||
apt_get install python3-dev
|
apt_get install python3-dev
|
||||||
setup_dev_lib "tobiko"
|
setup_dev_lib tobiko
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function tobiko_test_config {
|
function configure_tobiko {
|
||||||
|
# Write configuration to a new temporary file
|
||||||
local tobiko_conf=$(mktemp)
|
local tobiko_conf=$(mktemp)
|
||||||
if [ -f "${TOBIKO_CONF}" ]; then
|
if [ -f "${TOBIKO_CONF}" ]; then
|
||||||
|
# Start from existing tobiko.conf file
|
||||||
cp "${TOBIKO_CONF}" "${tobiko_conf}"
|
cp "${TOBIKO_CONF}" "${tobiko_conf}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# See ``lib/keystone`` where these users and tenants are set up
|
# See ``lib/keystone`` where these users and tenants are set up
|
||||||
echo_summary "Write identity options to ${TOBIKO_CONF}"
|
echo_summary "Write identity service options to ${TOBIKO_CONF}"
|
||||||
iniset "${tobiko_conf}" identity auth_url "$(get_auth_url)"
|
iniset "${tobiko_conf}" identity auth_url "$(get_auth_url)"
|
||||||
iniset "${tobiko_conf}" identity username "${ADMIN_USERNAME:-admin}"
|
iniset "${tobiko_conf}" identity username "${ADMIN_USERNAME:-admin}"
|
||||||
iniset "${tobiko_conf}" identity password "${ADMIN_PASSWORD:-secret}"
|
iniset "${tobiko_conf}" identity password "${ADMIN_PASSWORD:-secret}"
|
||||||
iniset "${tobiko_conf}" identity project "${ADMIN_TENANT_NAME:-admin}"
|
iniset "${tobiko_conf}" identity project "${ADMIN_TENANT_NAME:-admin}"
|
||||||
iniset "${tobiko_conf}" identity domain "${ADMIN_DOMAIN_NAME:-Default}"
|
iniset "${tobiko_conf}" identity domain "${ADMIN_DOMAIN_NAME:-Default}"
|
||||||
|
|
||||||
echo_summary "Write compute options to ${TOBIKO_CONF}"
|
echo_summary "Write compute service options to ${TOBIKO_CONF}"
|
||||||
iniset "${tobiko_conf}" compute image_ref "$(get_image_ref)"
|
iniset "${tobiko_conf}" compute image_ref "$(get_image_ref)"
|
||||||
iniset "${tobiko_conf}" compute flavor_ref "$(get_flavor_ref)"
|
iniset "${tobiko_conf}" compute flavor_ref "$(get_flavor_ref)"
|
||||||
|
|
||||||
echo_summary "Write network options to ${TOBIKO_CONF}"
|
echo_summary "Write networking options to ${TOBIKO_CONF}"
|
||||||
iniset "${tobiko_conf}" network floating_network_name \
|
iniset "${tobiko_conf}" network floating_network_name \
|
||||||
"$(get_floating_network_name)"
|
"$(get_floating_network_name)"
|
||||||
|
|
||||||
@@ -42,35 +44,50 @@ function get_auth_url {
|
|||||||
echo "${KEYSTONE_SERVICE_URI_V3:-${KEYSTONE_SERVICE_URI/v2.0/}}"
|
echo "${KEYSTONE_SERVICE_URI_V3:-${KEYSTONE_SERVICE_URI/v2.0/}}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_image_ref {
|
function get_image_ref {
|
||||||
local image_ids=( $(openstack image list -f value -c ID \
|
local name=${DEFAULT_IMAGE_NAME:-}
|
||||||
--property status=active) )
|
if [ "${name}" != "" ]; then
|
||||||
echo "${image_ids[0]}"
|
openstack image show -f value -c id "${name}"
|
||||||
|
else
|
||||||
|
openstack image list --limit 1 -f value -c ID --public --status active
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_flavor_ref {
|
function get_flavor_ref {
|
||||||
local flavor_ids=( $(openstack flavor list -f value -c ID \
|
local name=${DEFAULT_INSTANCE_TYPE:-}
|
||||||
--public) )
|
if [ "${name}" != "" ]; then
|
||||||
echo "${flavor_ids[0]}"
|
openstack flavor show -f value -c id "${name}"
|
||||||
|
else
|
||||||
|
openstack flavor list --limit 1 -f value -c ID --public
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_floating_network_name {
|
function get_floating_network_name {
|
||||||
local networks=( $(openstack network list -f value -c Name \
|
# the public network (for floating ip access) is only available
|
||||||
--enable --status ACTIVE \
|
# if the extension is enabled.
|
||||||
--provider-network-type flat) )
|
# If NEUTRON_CREATE_INITIAL_NETWORKS is not true, there is no network created
|
||||||
echo "${networks[0]}"
|
# and the public_network_id should not be set.
|
||||||
|
local name=${PUBLIC_NETWORK_NAME:-}
|
||||||
|
if [ "${name}" != "" ]; then
|
||||||
|
openstack network show -f value -c name "${name}"
|
||||||
|
else
|
||||||
|
local networks=( $( openstack network list -f value -c Name --enable \
|
||||||
|
--external) )
|
||||||
|
echo "${networks[0]}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [[ "$1" == "stack" ]]; then
|
if [[ "$1" == "stack" ]]; then
|
||||||
case "$2" in
|
case "$2" in
|
||||||
install)
|
install)
|
||||||
tobiko_install
|
install_tobiko
|
||||||
;;
|
;;
|
||||||
test-config)
|
test-config)
|
||||||
tobiko_test_config
|
configure_tobiko
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ SERVICE_PASSWORD=secret
|
|||||||
# User python 3
|
# User python 3
|
||||||
USE_PYTHON3=true
|
USE_PYTHON3=true
|
||||||
|
|
||||||
# Enable tobiko plugin
|
# Configure heat services ----------------------------------------------------
|
||||||
enable_plugin tobiko /vagrant
|
|
||||||
|
|
||||||
#Enable heat services
|
|
||||||
enable_plugin heat https://git.openstack.org/openstack/heat
|
enable_plugin heat https://git.openstack.org/openstack/heat
|
||||||
|
|
||||||
# download and register a VM image that heat can launch
|
# download and register a VM image that heat can launch
|
||||||
@@ -26,7 +23,7 @@ IMAGE_URL_PATH="/pub/fedora/linux/releases/29/Cloud/x86_64/images/"
|
|||||||
IMAGE_URL_FILE="Fedora-Cloud-Base-29-1.2.x86_64.qcow2"
|
IMAGE_URL_FILE="Fedora-Cloud-Base-29-1.2.x86_64.qcow2"
|
||||||
IMAGE_URLS+=","$IMAGE_URL_SITE$IMAGE_URL_PATH$IMAGE_URL_FILE
|
IMAGE_URLS+=","$IMAGE_URL_SITE$IMAGE_URL_PATH$IMAGE_URL_FILE
|
||||||
|
|
||||||
# Configure neutron
|
# Configure neutron ----------------------------------------------------------
|
||||||
enable_service neutron
|
enable_service neutron
|
||||||
NETWORK_API_EXTENSIONS=address-scope,agent,allowed-address-pairs,auto-allocated-topology,availability_zone,binding,default-subnetpools,dhcp_agent_scheduler,dns-domain-ports,dns-integration,dvr,empty-string-filtering,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,filter-validation,fip-port-details,flavors,ip-substring-filtering,l3-flavors,l3-ha,l3_agent_scheduler,logging,metering,multi-provider,net-mtu,net-mtu-writable,network-ip-availability,network_availability_zone,pagination,port-security,project-id,provider,qos,qos-bw-minimum-ingress,qos-fip,quotas,quota_details,rbac-policies,router,router_availability_zone,security-group,port-mac-address-regenerate,port-security-groups-filtering,segment,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-segment,standard-attr-timestamp,standard-attr-tag,subnet_allocation,trunk,trunk-details,uplink-status-propagation
|
NETWORK_API_EXTENSIONS=address-scope,agent,allowed-address-pairs,auto-allocated-topology,availability_zone,binding,default-subnetpools,dhcp_agent_scheduler,dns-domain-ports,dns-integration,dvr,empty-string-filtering,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,filter-validation,fip-port-details,flavors,ip-substring-filtering,l3-flavors,l3-ha,l3_agent_scheduler,logging,metering,multi-provider,net-mtu,net-mtu-writable,network-ip-availability,network_availability_zone,pagination,port-security,project-id,provider,qos,qos-bw-minimum-ingress,qos-fip,quotas,quota_details,rbac-policies,router,router_availability_zone,security-group,port-mac-address-regenerate,port-security-groups-filtering,segment,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-segment,standard-attr-timestamp,standard-attr-tag,subnet_allocation,trunk,trunk-details,uplink-status-propagation
|
||||||
|
|
||||||
@@ -52,3 +49,6 @@ IP_VERSION=4
|
|||||||
# IPV6_ADDRESS_MODE=slaac
|
# IPV6_ADDRESS_MODE=slaac
|
||||||
# IPV6_ADDRS_SAFE_TO_USE=fd$IPV6_GLOBAL_ID::/56
|
# IPV6_ADDRS_SAFE_TO_USE=fd$IPV6_GLOBAL_ID::/56
|
||||||
# IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
|
# IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
|
||||||
|
|
||||||
|
# Enable tobiko plugin ------------------------------------------------------
|
||||||
|
enable_plugin tobiko /vagrant
|
||||||
|
|||||||
Reference in New Issue
Block a user