Remove config-internal from designate

Change-Id: I15a9c34a08055c6f9ad53f211a8c1a62de3f58ff
Partially-Implements: blueprint remove-config-internal
This commit is contained in:
Steven Dake 2015-08-07 09:10:15 -07:00
parent ec272b8fe4
commit ba01f94206
41 changed files with 19 additions and 397 deletions

View File

@ -6,6 +6,6 @@ RUN yum install -y \
&& yum clean all
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-api/config-internal.sh

View File

@ -6,6 +6,6 @@ RUN yum install -y bind \
&& cp -pr /var/named /opt/kolla/var-named
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-backend-bind9/config-internal.sh

View File

@ -14,5 +14,3 @@ RUN yum install -y \
&& cp /etc/designate/policy.json /tmp/ \
&& rpm -e openstack-designate-api \
&& mv /tmp/policy.json /etc/designate/
COPY config-designate.sh /opt/kolla/config-designate.sh

View File

@ -1 +0,0 @@
../../../../common/designate/designate-base/config-designate.sh

View File

@ -6,6 +6,6 @@ RUN yum install -y \
&& yum clean all
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-central/config-internal.sh

View File

@ -5,6 +5,6 @@ RUN yum install -y openstack-designate-mdns \
&& yum clean all
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-mdns/config-internal.sh

View File

@ -8,6 +8,6 @@ RUN yum install -y \
&& yum clean all
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-poolmanager/config-internal.sh

View File

@ -7,6 +7,6 @@ RUN yum install -y \
&& yum clean all
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-sink/config-internal.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%designate-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-api/config-internal.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%designate-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-backend-bind9/config-internal.sh

View File

@ -12,6 +12,4 @@ RUN cd /designate \
&& cp -r /designate/etc/* /etc/designate/ \
&& rm -rf /root/.cache
COPY config-designate.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-base/config-designate.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%designate-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-central/config-internal.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%designate-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-mdns/config-internal.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%designate-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-poolmanager/config-internal.sh

View File

@ -2,6 +2,6 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%designate-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -1 +0,0 @@
../../../../common/designate/designate-sink/config-internal.sh

View File

@ -1,41 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-designate.sh
CONF=/etc/designate/designate.conf
check_required_vars ADMIN_TENANT_NAME \
DESIGNATE_API_SERVICE_HOST \
DESIGNATE_API_SERVICE_PORT \
DESIGNATE_KEYSTONE_PASSWORD \
DESIGNATE_KEYSTONE_USER \
KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT \
KEYSTONE_AUTH_PROTOCOL \
KEYSTONE_ADMIN_TOKEN
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
fail_unless_os_service_running keystone
crux user-create \
-n ${DESIGNATE_KEYSTONE_USER} \
-p ${DESIGNATE_KEYSTONE_PASSWORD} \
-t ${ADMIN_TENANT_NAME} \
-r admin
crux endpoint-create \
--remove-all \
-n ${DESIGNATE_KEYSTONE_USER} \
-t dns \
-I "${KEYSTONE_AUTH_PROTOCOL}://${DESIGNATE_API_SERVICE_HOST}:${DESIGNATE_API_SERVICE_PORT}/v1" \
-P "${KEYSTONE_AUTH_PROTOCOL}://${DESIGNATE_API_SERVICE_HOST}:${DESIGNATE_API_SERVICE_PORT}/v1" \
-A "${KEYSTONE_AUTH_PROTOCOL}://${DESIGNATE_API_SERVICE_HOST}:${DESIGNATE_API_SERVICE_PORT}/v1"
crudini --set $CONF service:api api_paste_config "/usr/share/designate/api-paste.ini"
crudini --set $CONF service:api api_port "${DESIGNATE_API_SERVICE_PORT}"
exec /usr/bin/designate-api

View File

@ -7,7 +7,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases

View File

@ -1,62 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
check_required_vars DESIGNATE_ALLOW_RECURSION \
DESIGNATE_BIND9_RNDC_KEY \
DESIGNATE_MASTERNS \
DESIGNATE_SLAVENS
NAMEDCFG=/etc/named.conf
# /var/named is coming from a VOLUME definition but at first boot it needs to
# be populated from the original container since else it would be missing some
# Bind9 core files. These files have been saved during the build phase.
if [ ! -f /var/named/named.ca ]; then
cp -pr /opt/kolla/var-named/* /var/named/
fi
# When rndc adds a new domain, bind adds the call in an nzf file in this
# directory.
chmod 770 /var/named
chown root:named /var/named
# Default Bind9 behavior is to enable recursion, disable if wanted.
if [ "${DESIGNATE_ALLOW_RECURSION}" == "false" ]; then
sed -i -r "s/(recursion) yes/\1 no/" $NAMEDCFG
fi
sed -i -r "/listen-on port 53/d" $NAMEDCFG
sed -i -r "/listen-on-v6/d" $NAMEDCFG
sed -i -r "s,/\* Path to ISC DLV key \*/,allow-new-zones yes;," $NAMEDCFG
sed -i -r "/allow-query .+;/d" $NAMEDCFG
if ! grep -q rndc-key /etc/named.conf; then
cat >> /etc/named.conf <<EOF
include "/etc/rndc.key";
controls {
inet ${DESIGNATE_SLAVENS} allow { ${DESIGNATE_MASTERNS}; } keys { "rndc-key"; };
};
EOF
fi
cat > /etc/rndc.key <<EOF
key "rndc-key" {
algorithm hmac-md5;
secret "${DESIGNATE_BIND9_RNDC_KEY}";
};
EOF
cat > /etc/rndc.conf <<EOF
options {
default-key "rndc-key";
default-server 127.0.0.1;
default-port 953;
};
EOF
cat /etc/rndc.key >> /etc/rndc.conf
chown named /etc/rndc.key
# Launch and keep in the foreground.
exec /usr/sbin/named -u named -g

View File

@ -4,10 +4,10 @@ set -o errexit
CMD="/usr/sbin/named"
ARGS="-u named -g"
# Loading common functions.
# Execute config strategy
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
exec $CMD $ARGS

View File

@ -1,88 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
get_or_create_domain() {
local DOMAIN_NAME=$1
DOMAIN_ID=$(designate domain-create --name $DOMAIN_NAME | awk '/id/ { print $4; }')
# Searching domain if not created
if [ -z $DOMAIN_ID ]; then
DOMAIN_ID=$(designate domain-list | awk "/$DOMAIN_NAME/ { print \$2; }")
fi
# Fail if domain still don't exist
if [ -z $DOMAIN_ID ]; then
echo "Creating domain failed" 1>&2
exit 1
fi
echo $DOMAIN_ID
}
check_required_vars DEBUG_LOGGING \
DESIGNATE_BACKEND \
DESIGNATE_BIND9_RNDC_KEY \
DESIGNATE_DB_NAME \
DESIGNATE_DB_PASSWORD \
DESIGNATE_DB_USER \
DESIGNATE_KEYSTONE_PASSWORD \
DESIGNATE_KEYSTONE_USER \
DESIGNATE_POOLMAN_POOLID \
KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT \
KEYSTONE_AUTH_PROTOCOL \
KEYSTONE_PUBLIC_SERVICE_HOST \
KEYSTONE_PUBLIC_SERVICE_PORT \
RABBITMQ_SERVICE_HOST \
RABBIT_PASSWORD \
RABBIT_USERID
fail_unless_db
dump_vars
cat > /openrc <<EOF
export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/v2.0"
export OS_USERNAME="${DESIGNATE_KEYSTONE_USER}"
export OS_PASSWORD="${DESIGNATE_KEYSTONE_PASSWORD}"
export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
EOF
conf=/etc/designate/designate.conf
# Regular configuration.
crudini --set $conf DEFAULT log_file ""
crudini --set $conf DEFAULT use_stderr "True"
crudini --set $conf DEFAULT debug "${DEBUG_LOGGING}"
crudini --set $conf DEFAULT rpc_backend "designate.openstack.common.rpc.impl_kombu"
crudini --set $conf oslo_messaging_rabbit rabbit_host "${RABBITMQ_SERVICE_HOST}"
crudini --set $conf oslo_messaging_rabbit rabbit_userid "${RABBIT_USERID}"
crudini --set $conf oslo_messaging_rabbit rabbit_password "${RABBIT_PASSWORD}"
crudini --set $conf storage:sqlalchemy connection "mysql://${DESIGNATE_DB_USER}:${DESIGNATE_DB_PASSWORD}@${MARIADB_SERVICE_HOST}/${DESIGNATE_DB_NAME}"
crudini --set $conf service:api auth_strategy "keystone"
crudini --set $conf service:api api_host "${PUBLIC_IP}"
# Eventhough this is a central-scoped item, it's used in other Designate
# components as well. Thus it should be configured here, from designate-base.
crudini --set $conf service:central default_pool_id "${DESIGNATE_POOLMAN_POOLID}"
crudini --set $conf keystone_authtoken identity_uri "${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}"
crudini --set $conf keystone_authtoken auth_uri "${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/v2.0"
crudini --set $conf keystone_authtoken admin_tenant_name "${ADMIN_TENANT_NAME}"
crudini --set $conf keystone_authtoken admin_user "${DESIGNATE_KEYSTONE_USER}"
crudini --set $conf keystone_authtoken admin_password "${DESIGNATE_KEYSTONE_PASSWORD}"
if [ "${DESIGNATE_BACKEND}" == "bind9" ]; then
# Configure a key for RNDC so it can connect with Bind9 to create/delete
# zones.
cat > /etc/rndc.key <<EOF
key "rndc-key" {
algorithm hmac-md5;
secret "${DESIGNATE_BIND9_RNDC_KEY}";
};
EOF
fi

View File

@ -1,28 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-designate.sh
check_required_vars DB_ROOT_PASSWORD \
DESIGNATE_DB_NAME \
DESIGNATE_DB_PASSWORD \
DESIGNATE_DB_USER \
INIT_DESIGNATE_DB \
MARIADB_SERVICE_HOST
fail_unless_db
CONF=/etc/designate/designate.conf
if [ "${INIT_DESIGNATE_DB}" == "true" ]; then
echo "Configuring database"
mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${DESIGNATE_DB_NAME};
GRANT ALL PRIVILEGES ON ${DESIGNATE_DB_NAME}.* TO '${DESIGNATE_DB_USER}'@'%' IDENTIFIED BY '${DESIGNATE_DB_PASSWORD}'
EOF
designate-manage database sync
fi
exec /usr/bin/designate-central

View File

@ -7,7 +7,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
exec $CMD $ARGS

View File

@ -1,18 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-designate.sh
check_required_vars DESIGNATE_MASTERNS \
DESIGNATE_MDNS_PORT
CONF=/etc/designate/designate.conf
crudini --set $CONF service:mdns workers "1"
crudini --set $CONF service:mdns host "${DESIGNATE_MASTERNS}"
crudini --set $CONF service:mdns port "${DESIGNATE_MDNS_PORT}"
crudini --set $CONF service:mdns tcp_backlog "100"
crudini --set $CONF service:mdns all_tcp "False"
exec /usr/bin/designate-mdns

View File

@ -7,7 +7,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
exec $CMD $ARGS

View File

@ -1,58 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-designate.sh
check_required_vars DESIGNATE_BACKEND \
DESIGNATE_DNS_PORT \
DESIGNATE_MASTERNS \
DESIGNATE_MDNS_PORT \
DESIGNATE_POOLMAN_NSS \
DESIGNATE_POOLMAN_POOLID \
DESIGNATE_POOLMAN_TARGETS \
DESIGNATE_SLAVENS
CONF=/etc/designate/designate.conf
if [ "${DESIGNATE_BACKEND}" == "bind9" ]; then
TYPE="bind9"
OPTIONS="rndc_host: ${DESIGNATE_SLAVENS}, rndc_key_file: /etc/rndc.key"
else
echo Unsupported backend: ${DESIGNATE_BACKEND}
exit
fi
crudini --set $CONF service:pool_manager workers "1"
crudini --set $CONF service:pool_manager enable_recovery_timer "False"
crudini --set $CONF service:pool_manager periodic_recovery_interval "120"
crudini --set $CONF service:pool_manager enable_sync_timer "True"
crudini --set $CONF service:pool_manager periodic_sync_interval "1800"
crudini --set $CONF service:pool_manager poll_max_retries "10"
crudini --set $CONF service:pool_manager poll_delay "5"
crudini --set $CONF service:pool_manager poll_retry_interval "15"
crudini --set $CONF service:pool_manager pool_id "${DESIGNATE_POOLMAN_POOLID}"
crudini --set $CONF service:pool_manager cache_driver "noop"
# TODO: use this to use memcached
#crudini --set $CONF service:pool_manager cache_driver memcache
#crudini --set $CONF service:pool_manager memcached_servers ${MEMCACHED_HOST}
# Specify the id of the pool managed through pool_manager. Central gets
# configured with this pool_id as well.
crudini --set $CONF service:pool_manager pool_id "${DESIGNATE_POOLMAN_POOLID}"
crudini --set $CONF pool:${DESIGNATE_POOLMAN_POOLID} nameservers "${DESIGNATE_POOLMAN_NSS}"
crudini --set $CONF pool:${DESIGNATE_POOLMAN_POOLID} targets "${DESIGNATE_POOLMAN_TARGETS}"
crudini --set $CONF pool_target:${DESIGNATE_POOLMAN_TARGETS} type "${TYPE}"
crudini --set $CONF pool_target:${DESIGNATE_POOLMAN_TARGETS} options "${OPTIONS}"
# This is the mdns container, which is the master nameserver.
crudini --set $CONF pool_target:${DESIGNATE_POOLMAN_TARGETS} masters "${DESIGNATE_MASTERNS}:${DESIGNATE_MDNS_PORT}"
crudini --set $CONF pool_target:${DESIGNATE_POOLMAN_TARGETS} host "${DESIGNATE_MASTERNS}"
crudini --set $CONF pool_target:${DESIGNATE_POOLMAN_TARGETS} port "${DESIGNATE_DNS_PORT}"
crudini --set $CONF pool_nameserver:${DESIGNATE_POOLMAN_NSS} host "${DESIGNATE_MASTERNS}"
crudini --set $CONF pool_nameserver:${DESIGNATE_POOLMAN_NSS} port "${DESIGNATE_DNS_PORT}"
exec /usr/bin/designate-pool-manager

View File

@ -7,7 +7,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
exec $CMD $ARGS

View File

@ -1,65 +0,0 @@
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-designate.sh
CONF=/etc/designate/designate.conf
configure_nova_handler() {
local DOMAIN_ID=$1
crudini --set $CONF handler:nova_fixed domain_id "$DOMAIN_ID"
crudini --set $CONF handler:nova_fixed notification_topics "notifications"
crudini --set $CONF handler:nova_fixed control_exchange "nova"
# Configuring multiple record formats
for FORMAT in $DESIGNATE_SINK_NOVA_FORMATS; do
crudini --set $CONF handler:nova_fixed format "$FORMAT"
done
}
configure_neutron_handler() {
local DOMAIN_ID=$1
crudini --set $CONF handler:neutron_floatingip domain_id "$DOMAIN_ID"
crudini --set $CONF handler:neutron_floatingip notification_topics "notifications"
crudini --set $CONF handler:neutron_floatingip control_exchange "neutron"
# Configuring multiple record formats
for FORMAT in $DESIGNATE_SINK_NEUTRON_FORMATS; do
crudini --set $CONF handler:neutron_floatingip format "$FORMAT"
done
}
check_required_vars DESIGNATE_API_SERVICE_HOST \
DESIGNATE_API_SERVICE_PORT \
DESIGNATE_DEFAULT_POOL_NS_RECORD
check_for_os_service_endpoint designate DESIGNATE_API_SERVICE_HOST DESIGNATE_API_SERVICE_PORT || exit $?
if [ -z "$DESIGNATE_SINK_NOVA_DOMAIN_NAME" && -z "$DESIGNATE_SINK_NEUTRON_DOMAIN_NAME" ]; then
echo "Please specify either Nova or Neutron domain name for Designate Sink"
exit 1
fi
designate server-create --name ${DESIGNATE_DEFAULT_POOL_NS_RECORD}
if [ $? != 0 ]; then
echo "Creating server failed" 1>&2
exit 1
fi
if [ -n "$DESIGNATE_SINK_NOVA_DOMAIN_NAME" ]; then
NOVA_DOMAIN_ID=$(get_or_create_domain $DESIGNATE_SINK_NOVA_DOMAIN_NAME)
configure_nova_handler $NOVA_DOMAIN_ID
HANDLERS="nova_fixed"
fi
if [ -n "$DESIGNATE_SINK_NEUTRON_DOMAIN_NAME" ]; then
NEUTRON_DOMAIN_ID=$(get_or_create_domain $DESIGNATE_SINK_NEUTRON_DOMAIN_NAME)
configure_neutron_handler $NEUTRON_DOMAIN_ID
[ -n "$HANDLERS" ] && HANDLERS+=","
HANDLERS+="neutron_floatingip"
fi
crudini --set $CONF service:sink enabled_notification_handlers "$HANDLERS"
exec /usr/bin/designate-sink

View File

@ -7,7 +7,7 @@ ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
# Execute config strategy
set_configs
exec $CMD $ARGS