Commit 49b5d0c4 authored by Endre Karlson's avatar Endre Karlson Committed by Endre Karlson

Remove deprecated devstack in contrib

Change-Id: I0ee9b2cc099848011743c9fffce7d8e957726bfb
Depends-On: I5f859408069789e1900546b57037e6994721e684
parent bb1b24c2
#!/usr/bin/env bash
# **designate.sh**
# Simple Tests to verify designate is running
echo "*********************************************************************"
echo "Begin DevStack Exercise: $0"
echo "*********************************************************************"
# This script exits on an error so that errors don't compound and you see
# only the first error that occurred.
set -o errexit
# Print the commands being run so that we can see the command that triggers
# an error. It is also useful for following allowing as the install occurs.
set -o xtrace
# Keep track of the current directory
EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
# Import common functions
source $TOP_DIR/functions
# Import configuration
source $TOP_DIR/openrc admin admin
# Import exercise configuration
source $TOP_DIR/exerciserc
# Skip if designate is not enabled
is_service_enabled designate || exit 55
# Import designate library
source $TOP_DIR/lib/designate
# Settings
# ========
# Used with dig to look up in DNS
DIG_TIMEOUT=30
if [ "$DESIGNATE_BACKEND_DRIVER" == "akamai" ]; then
# Akamai can be slow to propagate changes out
DIG_TIMEOUT=300
fi
# used with dig to look up in DNS
DIG_FLAGS="-p $DESIGNATE_SERVICE_PORT_DNS @$DESIGNATE_SERVICE_HOST"
# used with dig to do an AXFR against MDNS
DIG_AXFR_FLAGS="-p $DESIGNATE_SERVICE_PORT_MDNS @$DESIGNATE_SERVICE_HOST AXFR +tcp +nocmd"
# Functions
# =========
function cleanup {
# Try to cleanup any domains, this is important for backends like
# Akamai/Dyn, where state is not fully reset between test runs.
source $TOP_DIR/openrc admin admin
designate --all-tenants domain-list -f csv | awk 'BEGIN { FS = "," } ; {print $1}' | \
tail -n+2 | xargs --no-run-if-empty -n1 designate --all-tenants domain-delete
}
trap cleanup EXIT
function ensure_record_present {
local record_name=$1
local record_type=$2
local record_value=$3
if [ "$DESIGNATE_BACKEND_DRIVER" = "fake" ] ; then
# if the backend is fake, there will be no actual DNS records
return 0
fi
if ! timeout $DIG_TIMEOUT sh -c "while ! dig +short $DIG_FLAGS $record_name $record_type | grep \"$record_value\"; do sleep 1; done"; then
die $LINENO "Error: record $record_name ($record_type) not found in DNS"
fi
# Display for debugging
dig $DIG_FLAGS $record_name $record_type
return 0
}
function ensure_record_absent {
local record_name=$1
local record_type=$2
local record_value=$3
if [ "$DESIGNATE_BACKEND_DRIVER" = "fake" ] ; then
# if the backend is fake, there will be no actual DNS records
return 0
fi
if ! timeout $DIG_TIMEOUT sh -c "while dig +short $DIG_FLAGS $record_name $record_type | grep \"$record_value\"; do sleep 1; done"; then
# Display for debugging
dig $DIG_FLAGS $record_name $record_type
die $LINENO "Error: record $record_name ($record_type) found in DNS, should be absent"
fi
return 0
}
# do an AXFR request to MDNS
# if it does not match the expected value, give an error
function verify_axfr_in_mdns {
# Display for debugging
dig $DIG_AXFR_FLAGS "$1"
if dig $DIG_AXFR_FLAGS "$1"; then
if [ -n "$2" ] ; then
local axfr_records=$(dig $DIG_AXFR_FLAGS "$1" | grep "$1" | wc -l)
if [ "$axfr_records" = "$2" ] ; then
return 0
else
die $LINENO "Error: AXFR to MDNS did not return the expected number of records"
fi
fi
return 0
else
die $LINENO "Error: AXFR to MDNS did not return a correct response"
fi
}
# get the domain id (uuid) given the domain name
# if REQUIRED is set, die with an error if name not found
function get_domain_id {
local domain_name=$1
local required=$2
local domain_id=$(designate domain-list | egrep " $domain_name " | get_field 1)
if [ "$required" = "1" ] ; then
die_if_not_set $LINENO domain_id "Failure retrieving DOMAIN_ID"
fi
echo "$domain_id"
}
# get the domain_name given the id
function get_domain_name {
designate domain-list | grep "$1" | get_field 2
}
# if the given domain does not exist, it will be created
# the domain_id of the domain will be returned
function get_or_create_domain_id {
local domainid=$(get_domain_id "$1")
if [[ -z "$domainid" ]]; then
designate domain-create --name $1 --email admin@devstack.org --ttl 86400 --description "domain $1" 1>&2
domainid=$(designate domain-list | grep "$1" | get_field 1)
fi
echo $domainid
}
# get the record id (uuid) given the record name and domain id
# if REQUIRED is set, die with an error if name not found
function get_record_id {
local domain_id=$1
local record_name=$2
local record_type=$3
local required=$4
local record_id=$(designate record-list $domain_id | egrep " $record_name " | egrep " $record_type " | get_field 1)
if [ "$required" = "1" ] ; then
die_if_not_set $LINENO record_id "Failure retrieving RECORD_ID"
fi
echo "$record_id"
}
# Testing Servers
# ===============
designate server-list
# NUMBER_OF_RECORDS keeps track of the records we need to get for AXFR
# We start with the number of NS lines returned from server list
# (Header line makes up for SOA + Number of NS record lines)
NUMBER_OF_RECORDS=$(designate server-list -f csv | wc -l)
# Add 1 extra to account for the additional SOA at the end of the AXFR
((NUMBER_OF_RECORDS+=1))
# Testing Domains
# ===============
# List domains
designate domain-list
# Create random domain name
DOMAIN_NAME="exercise-$(openssl rand -hex 4).com."
# Create the domain
designate domain-create --name $DOMAIN_NAME --email devstack@example.org
DOMAIN_ID=$(get_domain_id $DOMAIN_NAME 1)
# Fetch the domain
designate domain-get $DOMAIN_ID
# List the nameservers hosting the domain
designate domain-servers-list $DOMAIN_ID
# Testing Records
# ===============
# Create random record name
A_RECORD_NAME="$(openssl rand -hex 4).${DOMAIN_NAME}"
# Create an A record
designate record-create $DOMAIN_ID --name $A_RECORD_NAME --type A --data 127.0.0.1
((NUMBER_OF_RECORDS++))
A_RECORD_ID=$(get_record_id $DOMAIN_ID $A_RECORD_NAME A)
# Fetch the record
designate record-get $DOMAIN_ID $A_RECORD_ID
# Verify the record is published in DNS
ensure_record_present $A_RECORD_NAME A 127.0.0.1
# -----
# Create random record name
AAAA_RECORD_NAME="$(openssl rand -hex 4).${DOMAIN_NAME}"
# Create an AAAA record
designate record-create $DOMAIN_ID --name $AAAA_RECORD_NAME --type AAAA --data "2607:f0d0:1002:51::4"
((NUMBER_OF_RECORDS++))
AAAA_RECORD_ID=$(get_record_id $DOMAIN_ID $AAAA_RECORD_NAME AAAA)
# Fetch the record
designate record-get $DOMAIN_ID $AAAA_RECORD_ID
# Verify the record is published in DNS
ensure_record_present $AAAA_RECORD_NAME AAAA 2607:f0d0:1002:51::4
# -----
# Create a MX record
designate record-create $DOMAIN_ID --name $DOMAIN_NAME --type MX --priority 5 --data "mail.example.com."
((NUMBER_OF_RECORDS++))
MX_RECORD_ID=$(get_record_id $DOMAIN_ID $DOMAIN_NAME MX)
# Fetch the record
designate record-get $DOMAIN_ID $MX_RECORD_ID
# Verify the record is published in DNS
ensure_record_present $DOMAIN_NAME MX "5 mail.example.com."
# -----
# Create a SRV record
designate record-create $DOMAIN_ID --name _sip._tcp.$DOMAIN_NAME --type SRV --priority 10 --data "5 5060 sip.example.com."
((NUMBER_OF_RECORDS++))
SRV_RECORD_ID=$(get_record_id $DOMAIN_ID _sip._tcp.$DOMAIN_NAME SRV)
# Fetch the record
designate record-get $DOMAIN_ID $SRV_RECORD_ID
# Verify the record is published in DNS
ensure_record_present _sip._tcp.$DOMAIN_NAME SRV "10 5 5060 sip.example.com."
# -----
# Create random record name
CNAME_RECORD_NAME="$(openssl rand -hex 4).${DOMAIN_NAME}"
# Create a CNAME record
designate record-create $DOMAIN_ID --name $CNAME_RECORD_NAME --type CNAME --data $DOMAIN_NAME
((NUMBER_OF_RECORDS++))
CNAME_RECORD_ID=$(get_record_id $DOMAIN_ID $CNAME_RECORD_NAME CNAME)
# Fetch the record
designate record-get $DOMAIN_ID $CNAME_RECORD_ID
# Verify the record is published in DNS
ensure_record_present $CNAME_RECORD_NAME CNAME $DOMAIN_NAME
# -----
# List Records
designate record-list $DOMAIN_ID
# Send an AXFR to MDNS and check for the records returned
verify_axfr_in_mdns $DOMAIN_NAME $NUMBER_OF_RECORDS
# -----
# Delete a Record
designate record-delete $DOMAIN_ID $CNAME_RECORD_ID
# List Records
designate record-list $DOMAIN_ID
# Fetch the record - should be gone
designate record-get $DOMAIN_ID $CNAME_RECORD_ID || echo "good - record was removed"
# verify not in DNS anymore
ensure_record_absent $CNAME_RECORD_NAME CNAME $DOMAIN_NAME
# Testing Domains Delete
# ======================
# Delete the domain
designate domain-delete $DOMAIN_ID
# Fetch the domain - should be gone
designate domain-get $DOMAIN_ID || echo "good - domain was removed"
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
echo "*********************************************************************"
# check for service enabled
if is_service_enabled designate; then
if [[ "$1" == "source" ]]; then
# Initial source of lib script
source $TOP_DIR/lib/designate
fi
if [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing Designate"
install_designate
echo_summary "Installing Designate Client"
install_designateclient
if is_service_enabled horizon; then
echo_summary "Installing Designate Dashboard"
install_designatedashboard
fi
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring Designate"
configure_designate
if is_service_enabled key; then
echo_summary "Creating Designate Keystone Accounts"
create_designate_accounts
fi
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
echo_summary "Initializing Designate"
init_designate
echo "Configuring Tempest options for Designate"
configure_designate_tempest
echo_summary "Starting Designate"
start_designate
echo_summary "Creating Pool NS Records"
create_designate_ns_records
fi
if [[ "$1" == "unstack" ]]; then
stop_designate
fi
if [[ "$1" == "clean" ]]; then
echo_summary "Cleaning Designate"
cleanup_designate
fi
fi
#!/bin/bash
set -ex
cd /opt/stack/new/designate/devstack/gate
./gate_hook.sh
#!/bin/bash
SOURCE_DIR=$(readlink -e $(dirname $(readlink -f $0)))
DEVSTACK_DIR=$(pwd -P)
pushd $SOURCE_DIR >> /dev/null
for path in lib/* extras.d/* exercises/*; do
if [ ! -e "$DEVSTACK_DIR/$path" ]; then
echo "Installing symlink for $path"
ln -fs $SOURCE_DIR/$path $DEVSTACK_DIR/$path
fi
done
popd >> /dev/null
This diff is collapsed.
# lib/designate_plugins/backend-akamai
# Configure the Akamai backend
# Requirements:
# An active Akamai account / contract will be requied to use this DevStack
# plugin.
# Enable with:
# DESIGNATE_BACKEND_DRIVER=akamai
# Dependencies:
# ``functions`` file
# ``designate`` configuration
# install_designate_backend - install any external requirements
# configure_designate_backend - make configuration changes, including those to other services
# init_designate_backend - initialize databases, etc.
# start_designate_backend - start any external services
# stop_designate_backend - stop any external services
# cleanup_designate_backend - remove transient data and cache
# Save trace setting
DP_AKAMAI_XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
DESIGNATE_AKAMAI_USERNAME=${DESIGNATE_AKAMAI_USERNAME:-username}
DESIGNATE_AKAMAI_PASSWORD=${DESIGNATE_AKAMAI_PASSWORD:-password}
DESIGNATE_AKAMAI_MASTERS=${DESIGNATE_AKAMAI_MASTERS:-"$DESIGNATE_SERVICE_HOST:$DESIGNATE_SERVICE_PORT_MDNS"}
DESIGNATE_AKAMAI_NAMESERVERS=${DESIGNATE_AKAMAI_NAMESERVERS:-""}
DESIGNATE_AKAMAI_ALSO_NOTIFIES=${DESIGNATE_AKAMAI_ALSO_NOTIFIES:-"193.108.155.34:53,23.73.134.141:53,80.67.64.148:53,23.73.134.237:53,23.73.133.141:53,23.73.133.237:53,80.67.64.10:53,72.246.0.10:53,72.247.45.157:53,72.246.192.168:53,193.108.152.143:53,60.254.128.45:53,72.247.45.110:53,72.247.45.65:53,72.247.45.25:53"}
# Pull in DESIGNATE_3RDPARTY_CREDS user/pass if set
if [ -n "$DESIGNATE_3RDPARTY_CREDS" ]; then
DESIGNATE_AKAMAI_USERNAME=`echo $DESIGNATE_3RDPARTY_CREDS | cut -f1 -d:`
DESIGNATE_AKAMAI_PASSWORD=`echo $DESIGNATE_3RDPARTY_CREDS | cut -f2- -d:`
fi
# Sanity Checks
# -------------
if [ -z "$DESIGNATE_AKAMAI_NAMESERVERS" ]; then
die $LINENO "You must configure DESIGNATE_AKAMAI_NAMESERVERS"
fi
if [ "$DESIGNATE_SERVICE_PORT_MDNS" != "53" ]; then
die $LINENO "Akamai requires DESIGNATE_SERVICE_PORT_MDNS is set to '53'"
fi
# Entry Points
# ------------
# install_designate_backend - install any external requirements
function install_designate_backend {
:
}
# configure_designate_backend - make configuration changes, including those to other services
function configure_designate_backend {
iniset $DESIGNATE_CONF pool_target:$DESIGNATE_TARGET_ID type akamai
iniset $DESIGNATE_CONF pool_target:$DESIGNATE_TARGET_ID masters $DESIGNATE_AKAMAI_MASTERS
iniset $DESIGNATE_CONF pool_target:$DESIGNATE_TARGET_ID options "username: $DESIGNATE_AKAMAI_USERNAME, password: $DESIGNATE_AKAMAI_PASSWORD"
# Create a Pool Nameserver for each of the Akamai nameservers
local nameserver_ids=""
IFS=',' read -a nameservers <<< "$DESIGNATE_AKAMAI_NAMESERVERS"
for nameserver in "${nameservers[@]}"; do
local nameserver_id=`uuidgen`
iniset $DESIGNATE_CONF pool_nameserver:$nameserver_id host $(dig +short A $nameserver | head -n 1)
iniset $DESIGNATE_CONF pool_nameserver:$nameserver_id port 53
# Append the Nameserver ID to the list
nameserver_ids+=${nameserver_id},
done
# Configure the Pool for the set of nameserver IDs, minus the trailing comma
iniset $DESIGNATE_CONF pool:$DESIGNATE_POOL_ID nameservers "${nameserver_ids:0:-1}"
# Configure the Pool to Notify Akamai's Transfer Agents
iniset $DESIGNATE_CONF pool:$DESIGNATE_POOL_ID also_notifies "$DESIGNATE_AKAMAI_ALSO_NOTIFIES"
}
# create_designate_ns_records - Create Pool NS Records
function create_designate_ns_records_backend {
# Build an array of the Akamai nameservers.
IFS=',' read -a ns_records <<< "$DESIGNATE_AKAMAI_NAMESERVERS"
# Create a NS Record for each of the Akamai nameservers
for ns_record in "${ns_records[@]}"; do
designate server-create --name "${ns_record%%.}."
done
}
# init_designate_backend - initialize databases, etc.
function init_designate_backend {
:
}
# start_designate_backend - start any external services
function start_designate_backend {
:
}
# stop_designate_backend - stop any external services
function stop_designate_backend {
:
}
# cleanup_designate_backend - remove transient data and cache
function cleanup_designate_backend {
:
}
# Restore xtrace
$DP_AKAMAI_XTRACE
# lib/designate_plugins/backend-bind9
# Configure the bind9 pool backend
# Enable with:
# DESIGNATE_BACKEND_DRIVER=bind9
# Dependencies:
# ``functions`` file
# ``designate`` configuration
# install_designate_backend - install any external requirements
# configure_designate_backend - make configuration changes, including those to other services
# init_designate_backend - initialize databases, etc.
# start_designate_backend - start any external services
# stop_designate_backend - stop any external services
# cleanup_designate_backend - remove transient data and cache
# Save trace setting
DP_BIND9_XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
BIND_SERVICE_NAME=bind9
BIND_CFG_DIR=/etc/bind
BIND_VAR_DIR=/var/cache/bind
BIND_CFG_FILE=$BIND_CFG_DIR/named.conf.options
BIND_USER=bind
BIND_GROUP=bind
DESIGNATE_SERVICE_PORT_RNDC=${DESIGNATE_SERVICE_PORT_RNDC:-953}
if is_fedora; then
BIND_SERVICE_NAME=named
BIND_CFG_DIR=/etc/named
BIND_CFG_FILE=/etc/named.conf
BIND_VAR_DIR=/var/named
BIND_USER=named
BIND_GROUP=named
fi
# Entry Points
# ------------
# install_designate_backend - install any external requirements
function install_designate_backend {
if is_ubuntu; then
install_package bind9
elif is_fedora; then
install_package named
fi
# The user that designate runs as needs to be member of **$BIND_GROUP** group.
# The designate bind9 backend needs read/write access to $BIND_VAR_DIR
if ! getent group $BIND_GROUP >/dev/null; then
sudo groupadd $BIND_GROUP
fi
add_user_to_group $STACK_USER $BIND_GROUP
if [[ ! -d $BIND_CFG_DIR ]]; then
sudo mkdir -p $BIND_CFG_DIR
sudo chown $BIND_USER:$BIND_GROUP $BIND_CFG_DIR
fi
sudo chown -R $BIND_USER:$BIND_GROUP $BIND_CFG_DIR $BIND_VAR_DIR
sudo chmod -R g+r $BIND_CFG_DIR
sudo chmod -R g+rw $BIND_VAR_DIR
# Customize Bind9 apparmor profile if installed
if [[ -d /etc/apparmor.d ]]; then
sudo tee /etc/apparmor.d/local/usr.sbin.named > /dev/null << EOF
$DESIGNATE_STATE_PATH/bind9/** rw,
EOF
restart_service apparmor
fi
}
# configure_designate_backend - make configuration changes, including those to other services
function configure_designate_backend {
iniset $DESIGNATE_CONF pool_target:$DESIGNATE_TARGET_ID type bind9
iniset $DESIGNATE_CONF pool_target:$DESIGNATE_TARGET_ID masters $DESIGNATE_SERVICE_HOST:$DESIGNATE_SERVICE_PORT_MDNS
iniset $DESIGNATE_CONF pool_target:$DESIGNATE_TARGET_ID options "rndc_host: $DESIGNATE_SERVICE_HOST, rndc_port: $DESIGNATE_SERVICE_PORT_RNDC, rndc_config_file: $BIND_CFG_DIR/rndc.conf, rndc_key_file: $BIND_CFG_DIR/rndc.key, host: $DESIGNATE_SERVICE_HOST, port: $DESIGNATE_SERVICE_PORT_DNS"
# DevStack Managed BIND NameServer
local nameserver_id=`uuidgen`
iniset $DESIGNATE_CONF pool:$DESIGNATE_POOL_ID nameservers $nameserver_id
iniset $DESIGNATE_CONF pool_nameserver:$nameserver_id host $DESIGNATE_SERVICE_HOST
iniset $DESIGNATE_CONF pool_nameserver:$nameserver_id port $DESIGNATE_SERVICE_PORT_DNS
sudo chown $STACK_USER $BIND_CFG_DIR
# create rndc key and config
sudo rndc-confgen -a -c $BIND_CFG_DIR/rndc.key
sudo chown $BIND_USER:$BIND_GROUP $BIND_CFG_DIR/rndc.key
sudo chmod g+r $BIND_CFG_DIR/rndc.key
# Configure Bind
sudo tee $BIND_CFG_FILE > /dev/null <<EOF
include "$BIND_CFG_DIR/rndc.key";
options {
directory "$BIND_VAR_DIR";
allow-new-zones yes;
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on port $DESIGNATE_SERVICE_PORT_DNS { $DESIGNATE_SERVICE_HOST; };
recursion no;
minimal-responses yes;
};
controls {
inet $DESIGNATE_SERVICE_HOST port $DESIGNATE_SERVICE_PORT_RNDC allow { $DESIGNATE_SERVICE_HOST; } keys { "rndc-key"; };
};
EOF
# Configure RNDC
sudo tee $BIND_CFG_DIR/rndc.conf > /dev/null << EOF
include "$BIND_CFG_DIR/rndc.key";
options {
default-key "rndc-key";
default-server $DESIGNATE_SERVICE_HOST;
default-port $DESIGNATE_SERVICE_PORT_RNDC;
};
EOF
sudo chown $BIND_USER:$BIND_GROUP $BIND_CFG_FILE $BIND_CFG_DIR/rndc.conf
sudo chmod g+r $BIND_CFG_FILE $BIND_CFG_DIR/rndc.conf
restart_service $BIND_SERVICE_NAME
}
# init_designate_backend - initialize databases, etc.
function init_designate_backend {
:
}
# start_designate_backend - start any external services
function start_designate_backend {
start_service bind9
}
# stop_designate_backend - stop any external services
function stop_designate_backend {
stop_service bind9
}
# cleanup_designate_backend - remove transient data and cache
function cleanup_designate_backend {
sudo sh -c "rm -rf $BIND_VAR_DIR/*.nzf"
sudo sh -c "rm -rf $BIND_VAR_DIR/slave.*"
sudo rm -f $BIND_CFG_DIR/rndc.key
}
# Restore xtrace
$DP_BIND9_XTRACE
# lib/designate_plugins/backend-designate
# Configure the designate backend
# Requirements:
# Another Designate service is needed in order to install the SECONDARY zones in it.
# Enable with:
# DESIGNATE_BACKEND_DRIVER=designate
# Dependencies:
# ``functions`` file
# ``designate`` configuration
# install_designate_backend - install any external requirements
# configure_designate_backend - make configuration changes, including those to other services
# init_designate_backend - initialize databases, etc.
# start_designate_backend - start any external services
# stop_designate_backend - stop any external services
# cleanup_designate_backend - remove transient data and cache
# Save trace setting
DP_D2D_XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
# This is the Primary Designate MDNS servers.
DESIGNATE_D2D_MASTERS=${DESIGNATE_D2D_MASTERS:-""}
# DNS server to notify (MiniDNS ip:port)
DESIGNATE_D2D_ALSO_NOTIES=${DESIGNATE_D2D_ALSO_NOTIES:-""}
# DNS server to check SOA etc against
DESIGNATE_D2D_NAMESERVERS=${DESIGNATE_D2D_NAMESERVERS:-""}
# Destination openstack credentials
DESIGNATE_D2D_KS_VERSION=${DESIGNATE_D2D_KS_VERSION:-3}
DESIGNATE_D2D_AUTH_URL=${DESIGNATE_D2D_AUTH_URL:-}
DESIGNATE_D2D_USERNAME=${DESIGNATE_D2D_USERNAME:-}
DESIGNATE_D2D_PASSWORD=${DESIGNATE_D2D_PASSWORD:-}
# Keystone V2
DESIGNATE_D2D_TENANT_NAME=${DESIGNATE_D2D_TENANT_NAME:-}
DESIGNATE_D2D_TENANT_NAME=${DESIGNATE_D2D_TENANT_ID:-}
# Keystone V3
DESIGNATE_D2D_PROJECT_NAME=${DESIGNATE_D2D_PROJECT_NAME:-}
DESIGNATE_D2D_PROJECT_DOMAIN_NAME=${DESIGNATE_D2D_PROJECT_DOMAIN_NAME:-}
DESIGNATE_D2D_USER_DOMAIN_NAME=${DESIGNATE_D2D_USER_DOMAIN_NAME:-}
# Entry Points
# ------------
# install_designate_backend - install any external requirements
function install_designate_backend {
:
}
# configure_designate_backend - make configuration changes, including those to other services
function configure_designate_backend {
iniset $DESIGNATE_CONF pool_target:$DESIGNATE_TARGET_ID type designate
iniset $DESIGNATE_CONF pool_target:$DESIGNATE_TARGET_ID masters $DESIGNATE_D2D_MASTERS
options="auth_url: $DESIGNATE_D2D_AUTH_URL, username: $DESIGNATE_D2D_USERNAME, password: $DESIGNATE_D2D_PASSWORD,"
if [ "$DESIGNATE_D2D_KS_VERSION" == "2" ]; then
if [ ! -z "$DESIGNATE_D2D_TENANT_NAME" ]; then
options="$options tenant_name=$DESIGNATE_D2D_TENANT_NAME,"
fi
if [ ! -z "$DESIGNATE_D2D_TENANT_ID" ]; then
options="$options tenant_id=$DESIGNATE_D2D_TENANT_ID,"