From 60b6c1d81e8735a50fcf776d5618d5b1dc82ff00 Mon Sep 17 00:00:00 2001 From: Harm Weites Date: Thu, 2 Jul 2015 23:37:16 +0200 Subject: [PATCH] Add config-internal/config-external to Swift containers These containers look to be broken, bad. Fixing them should be done through a separate bug. Here we only focus on getting aligned for Ansible deployments. Partially Implements: Blueprint standard-start Change-Id: I9d538f2c39510266f30cfed88e01c203f35bfb8e --- .../binary/swift/swift-account/Dockerfile | 4 +- .../swift/swift-account/config-external.sh | 1 + .../swift/swift-account/config-internal.sh | 1 + .../binary/swift/swift-container/Dockerfile | 4 +- .../swift/swift-container/config-external.sh | 1 + .../swift/swift-container/config-internal.sh | 1 + .../binary/swift/swift-object/Dockerfile | 4 +- .../swift/swift-object/config-external.sh | 1 + .../swift/swift-object/config-internal.sh | 1 + .../swift/swift-proxy-server/Dockerfile | 4 +- .../swift-proxy-server/config-external.sh | 1 + .../swift-proxy-server/config-internal.sh | 1 + .../swift/swift-account/config-external.sh | 10 +++++ .../swift/swift-account/config-internal.sh | 34 +++++++++++++++++ docker/common/swift/swift-account/start.sh | 37 ++++--------------- .../swift/swift-container/config-external.sh | 10 +++++ .../swift/swift-container/config-internal.sh | 34 +++++++++++++++++ docker/common/swift/swift-container/start.sh | 37 ++++--------------- .../swift/swift-object/config-external.sh | 10 +++++ .../swift/swift-object/config-internal.sh | 34 +++++++++++++++++ docker/common/swift/swift-object/start.sh | 37 ++++--------------- .../swift-proxy-server/config-external.sh | 10 +++++ .../swift-proxy-server/config-internal.sh | 5 +++ .../common/swift/swift-proxy-server/start.sh | 12 +++++- 24 files changed, 201 insertions(+), 93 deletions(-) create mode 120000 docker/centos/binary/swift/swift-account/config-external.sh create mode 120000 docker/centos/binary/swift/swift-account/config-internal.sh create mode 120000 docker/centos/binary/swift/swift-container/config-external.sh create mode 120000 docker/centos/binary/swift/swift-container/config-internal.sh create mode 120000 docker/centos/binary/swift/swift-object/config-external.sh create mode 120000 docker/centos/binary/swift/swift-object/config-internal.sh create mode 120000 docker/centos/binary/swift/swift-proxy-server/config-external.sh create mode 120000 docker/centos/binary/swift/swift-proxy-server/config-internal.sh create mode 100755 docker/common/swift/swift-account/config-external.sh create mode 100644 docker/common/swift/swift-account/config-internal.sh mode change 100644 => 100755 docker/common/swift/swift-account/start.sh create mode 100755 docker/common/swift/swift-container/config-external.sh create mode 100644 docker/common/swift/swift-container/config-internal.sh mode change 100644 => 100755 docker/common/swift/swift-container/start.sh create mode 100755 docker/common/swift/swift-object/config-external.sh create mode 100644 docker/common/swift/swift-object/config-internal.sh mode change 100644 => 100755 docker/common/swift/swift-object/start.sh create mode 100755 docker/common/swift/swift-proxy-server/config-external.sh create mode 100644 docker/common/swift/swift-proxy-server/config-internal.sh mode change 100644 => 100755 docker/common/swift/swift-proxy-server/start.sh diff --git a/docker/centos/binary/swift/swift-account/Dockerfile b/docker/centos/binary/swift/swift-account/Dockerfile index 2c26802e38..6c8d1cc199 100644 --- a/docker/centos/binary/swift/swift-account/Dockerfile +++ b/docker/centos/binary/swift/swift-account/Dockerfile @@ -2,5 +2,7 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%% MAINTAINER Kolla Project (https://launchpad.net/kolla) ADD ./start.sh /start.sh -CMD ["/start.sh"] +COPY config-internal.sh config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker/centos/binary/swift/swift-account/config-external.sh b/docker/centos/binary/swift/swift-account/config-external.sh new file mode 120000 index 0000000000..e7c6637fe4 --- /dev/null +++ b/docker/centos/binary/swift/swift-account/config-external.sh @@ -0,0 +1 @@ +../../../../common/swift/swift-account/config-external.sh \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-account/config-internal.sh b/docker/centos/binary/swift/swift-account/config-internal.sh new file mode 120000 index 0000000000..48504d07e0 --- /dev/null +++ b/docker/centos/binary/swift/swift-account/config-internal.sh @@ -0,0 +1 @@ +../../../../common/swift/swift-account/config-internal.sh \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-container/Dockerfile b/docker/centos/binary/swift/swift-container/Dockerfile index 2c26802e38..6c8d1cc199 100644 --- a/docker/centos/binary/swift/swift-container/Dockerfile +++ b/docker/centos/binary/swift/swift-container/Dockerfile @@ -2,5 +2,7 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%% MAINTAINER Kolla Project (https://launchpad.net/kolla) ADD ./start.sh /start.sh -CMD ["/start.sh"] +COPY config-internal.sh config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker/centos/binary/swift/swift-container/config-external.sh b/docker/centos/binary/swift/swift-container/config-external.sh new file mode 120000 index 0000000000..efc76b7af4 --- /dev/null +++ b/docker/centos/binary/swift/swift-container/config-external.sh @@ -0,0 +1 @@ +../../../../common/swift/swift-container/config-external.sh \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-container/config-internal.sh b/docker/centos/binary/swift/swift-container/config-internal.sh new file mode 120000 index 0000000000..789a210a3f --- /dev/null +++ b/docker/centos/binary/swift/swift-container/config-internal.sh @@ -0,0 +1 @@ +../../../../common/swift/swift-container/config-internal.sh \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-object/Dockerfile b/docker/centos/binary/swift/swift-object/Dockerfile index 2c26802e38..6c8d1cc199 100644 --- a/docker/centos/binary/swift/swift-object/Dockerfile +++ b/docker/centos/binary/swift/swift-object/Dockerfile @@ -2,5 +2,7 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%% MAINTAINER Kolla Project (https://launchpad.net/kolla) ADD ./start.sh /start.sh -CMD ["/start.sh"] +COPY config-internal.sh config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker/centos/binary/swift/swift-object/config-external.sh b/docker/centos/binary/swift/swift-object/config-external.sh new file mode 120000 index 0000000000..f4256fa63d --- /dev/null +++ b/docker/centos/binary/swift/swift-object/config-external.sh @@ -0,0 +1 @@ +../../../../common/swift/swift-object/config-external.sh \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-object/config-internal.sh b/docker/centos/binary/swift/swift-object/config-internal.sh new file mode 120000 index 0000000000..3f8ba1de93 --- /dev/null +++ b/docker/centos/binary/swift/swift-object/config-internal.sh @@ -0,0 +1 @@ +../../../../common/swift/swift-object/config-internal.sh \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-proxy-server/Dockerfile b/docker/centos/binary/swift/swift-proxy-server/Dockerfile index 2c26802e38..6c8d1cc199 100644 --- a/docker/centos/binary/swift/swift-proxy-server/Dockerfile +++ b/docker/centos/binary/swift/swift-proxy-server/Dockerfile @@ -2,5 +2,7 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%% MAINTAINER Kolla Project (https://launchpad.net/kolla) ADD ./start.sh /start.sh -CMD ["/start.sh"] +COPY config-internal.sh config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker/centos/binary/swift/swift-proxy-server/config-external.sh b/docker/centos/binary/swift/swift-proxy-server/config-external.sh new file mode 120000 index 0000000000..04e1c640f6 --- /dev/null +++ b/docker/centos/binary/swift/swift-proxy-server/config-external.sh @@ -0,0 +1 @@ +../../../../common/swift/swift-proxy-server/config-external.sh \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-proxy-server/config-internal.sh b/docker/centos/binary/swift/swift-proxy-server/config-internal.sh new file mode 120000 index 0000000000..f95866fdd5 --- /dev/null +++ b/docker/centos/binary/swift/swift-proxy-server/config-internal.sh @@ -0,0 +1 @@ +../../../../common/swift/swift-proxy-server/config-internal.sh \ No newline at end of file diff --git a/docker/common/swift/swift-account/config-external.sh b/docker/common/swift/swift-account/config-external.sh new file mode 100755 index 0000000000..2de263dda0 --- /dev/null +++ b/docker/common/swift/swift-account/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/swift-account/swift.conf" +TARGET="/etc/swift/swift.conf" +OWNER="swift" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/swift/swift-account/config-internal.sh b/docker/common/swift/swift-account/config-internal.sh new file mode 100644 index 0000000000..bf86830f98 --- /dev/null +++ b/docker/common/swift/swift-account/config-internal.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +: ${SWIFT_DB_USER:=swift} +: ${SWIFT_DB_NAME:=swift} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${SWIFT_KEYSTONE_USER:=swift} +: ${ADMIN_TENANT_NAME:=admin} + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + SWIFT_ADMIN_PASSWORD +fail_unless_db +fail_unless_os_service_running keystone + +if ! [ "$SWIFT_DB_PASSWORD" ]; then + SWIFT_DB_PASSWORD=$(openssl rand -hex 15) + export SWIFT_DB_PASSWORD +fi + +sh /opt/swift/config-swift.sh account-server + +mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <