Add Tobiko credentials to devstack plugin

This patch adds new settings to Tobiko's Devstack plugin to
configure credentials used in Tobiko.

Change-Id: I4b7e6cbea437b5a4c4b7789ea7f5c04a948c7fdf
This commit is contained in:
Slawek Kaplonski 2019-04-03 10:16:28 +02:00 committed by Federico Ressi
parent 5423c0969c
commit 94432dd1b6
3 changed files with 36 additions and 9 deletions

View File

@ -18,15 +18,7 @@ function configure_tobiko {
fi
# See ``lib/keystone`` where these users and tenants are set up
echo_summary "Write Keystone service options to ${TOBIKO_CONF}"
iniset "${tobiko_conf}" keystone auth_url "$(get_keystone_auth_url)"
iniset "${tobiko_conf}" keystone username "${ADMIN_USERNAME:-admin}"
iniset "${tobiko_conf}" keystone password "${ADMIN_PASSWORD:-secret}"
iniset "${tobiko_conf}" keystone project_name "${ADMIN_TENANT_NAME:-admin}"
iniset "${tobiko_conf}" keystone user_domain_name \
"${ADMIN_DOMAIN_NAME:-Default}"
iniset "${tobiko_conf}" keystone project_domain_name \
"${ADMIN_DOMAIN_NAME:-Default}"
configure_keystone_credentials
echo_summary "Write compute service options to ${TOBIKO_CONF}"
iniset "${tobiko_conf}" nova image "$(get_image)"
@ -58,6 +50,31 @@ function get_image {
}
function configure_keystone_credentials {
echo_summary "Write Keystone service options to ${TOBIKO_CONF}"
iniset "${tobiko_conf}" keystone auth_url "$(get_keystone_auth_url)"
TOBIKO_PROJECT_ID=$(get_or_create_project \
"${TOBIKO_KEYSTONE_PROJECT_NAME}" "${TOBIKO_KEYSTONE_PROJECT_DOMAIN_NAME}")
TOBIKO_USER_ID=$(get_or_create_user ${TOBIKO_KEYSTONE_USERNAME} \
"${TOBIKO_KEYSTONE_PASSWORD}" "${TOBIKO_KEYSTONE_USER_DOMAIN_NAME}")
get_or_add_user_project_role "${TOBIKO_KEYSTONE_USER_ROLE}" \
"${TOBIKO_USER_ID}" "${TOBIKO_PROJECT_ID}"
get_or_add_user_domain_role "${TOBIKO_KEYSTONE_USER_ROLE}" \
"${TOBIKO_USER_ID}" "${TOBIKO_KEYSTONE_USER_DOMAIN_NAME}"
iniset "${tobiko_conf}" keystone username "${TOBIKO_KEYSTONE_USERNAME}"
iniset "${tobiko_conf}" keystone password "${TOBIKO_KEYSTONE_PASSWORD}"
iniset "${tobiko_conf}" keystone project_name "${TOBIKO_KEYSTONE_PROJECT_NAME}"
iniset "${tobiko_conf}" keystone user_domain_name \
"${TOBIKO_KEYSTONE_USER_DOMAIN_NAME}"
iniset "${tobiko_conf}" keystone project_domain_name \
"${TOBIKO_KEYSTONE_PROJECT_DOMAIN_NAME}"
}
function get_flavor {
local name=${DEFAULT_INSTANCE_TYPE:-}
if [ "${name}" != "" ]; then

View File

@ -3,3 +3,10 @@ GITDIR["tobiko"]=$DEST/tobiko
GITBRANCH["tobiko"]=master
TOBIKO_CONF=/etc/tobiko/tobiko.conf
TOBIKO_KEYSTONE_USER_ROLE=${TOBIKO_KEYSTONE_USER_ROLE:-Member}
TOBIKO_KEYSTONE_USERNAME=${TOBIKO_KEYSTONE_USERNAME:-admin}
TOBIKO_KEYSTONE_PASSWORD=${TOBIKO_KEYSTONE_PASSWORD:-secret}
TOBIKO_KEYSTONE_PROJECT_NAME=${TOBIKO_KEYSTONE_PROJECT_NAME:-admin}
TOBIKO_KEYSTONE_USER_DOMAIN_NAME=${TOBIKO_KEYSTONE_USER_DOMAIN_NAME:-Default}
TOBIKO_KEYSTONE_PROJECT_DOMAIN_NAME=${TOBIKO_KEYSTONE_PROJECT_DOMAIN_NAME:-Default}

View File

@ -20,6 +20,9 @@
USE_PYTHON3: true
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
MULTI_HOST: 1
TOBIKO_KEYSTONE_USERNAME: tobiko
TOBIKO_KEYSTONE_PASSWORD: secret_tobiko
TOBIKO_KEYSTONE_PROJECT_NAME: tobiko
devstack_plugins:
heat: https://git.openstack.org/openstack/heat.git
neutron: https://git.openstack.org/openstack/neutron.git