diff --git a/docker/centos/binary/swift/swift-base/build-swift-ring.py b/docker/centos/binary/swift/swift-base/build-swift-ring.py deleted file mode 120000 index 325bf93c5b..0000000000 --- a/docker/centos/binary/swift/swift-base/build-swift-ring.py +++ /dev/null @@ -1 +0,0 @@ -../../../../../docker/common/swift/swift-base/build-swift-ring.py \ No newline at end of file diff --git a/docker/centos/source/swift/swift-base/build-swift-ring.py b/docker/centos/source/swift/swift-base/build-swift-ring.py deleted file mode 120000 index 325bf93c5b..0000000000 --- a/docker/centos/source/swift/swift-base/build-swift-ring.py +++ /dev/null @@ -1 +0,0 @@ -../../../../../docker/common/swift/swift-base/build-swift-ring.py \ No newline at end of file diff --git a/docker/common/swift/swift-account-server/config-external.sh b/docker/common/swift/swift-account-server/config-external.sh deleted file mode 100644 index 61adefcd06..0000000000 --- a/docker/common/swift/swift-account-server/config-external.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -if [[ -f /opt/kolla/swift/swift.conf ]]; then - cp /opt/kolla/swift/swift.conf /etc/swift/ - chown swift: /etc/swift/swift.conf - chmod 0640 /etc/swift/swift.conf -fi - -if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then - cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz - chown swift: /etc/swift/account.ring.gz - chmod 0640 /etc/swift/account.ring.gz -fi - -if [[ -f /opt/kolla/swift-account-server/account-server.conf ]]; then - cp /opt/kolla/swift-account-server/account-server.conf /etc/swift/ - chown swift: /etc/swift/account-server.conf - chmod 0640 /etc/swift/account-server.conf -fi diff --git a/docker/common/swift/swift-account-server/start.sh b/docker/common/swift/swift-account-server/start.sh deleted file mode 100755 index 402ee6f44f..0000000000 --- a/docker/common/swift/swift-account-server/start.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -o errexit - -CMD="/usr/bin/swift-account-server" -ARGS="/etc/swift/account-server.conf --verbose" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -source /opt/kolla/config-swift.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/swift/swift-base/build-swift-ring.py b/docker/common/swift/swift-base/build-swift-ring.py deleted file mode 100644 index d7386392d9..0000000000 --- a/docker/common/swift/swift-base/build-swift-ring.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2015 Paul Bourke -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -This script is a simple wrapper used to create and rebalance Swift ring files. -""" - -import argparse -import subprocess -import sys - - -def setup_args(): - parser = argparse.ArgumentParser() - parser.add_argument("-f", "--ring-file", - required=True, - help="Path to ring file") - parser.add_argument("-p", "--part-power", - required=True, - help="Part power") - parser.add_argument("-r", "--num-replicas", - required=True, - help="Number of replicas") - parser.add_argument("-m", "--min-part-hours", - required=True, - help="Min part hours") - parser.add_argument("-H", "--hosts", - required=True, - help="Hosts in the ring, comma delimited") - parser.add_argument("-w", "--weights", - required=True, - help="Weight of each host, comma delimited") - parser.add_argument("-d", "--devices", - required=True, - help="Device on each host, comma delimited") - parser.add_argument("-z", "--zones", - required=True, - help="Zone of each host, comma delimited") - return parser.parse_args() - - -def run_cmd(cmd): - print(' '.join(cmd)) - subprocess.call(cmd) - - -def run(args): - hosts = args.hosts.split(',') - weights = args.weights.split(',') - zones = args.zones.split(',') - devices = args.devices.split(',') - if not (len(hosts) == len(weights) == len(zones) == len(devices)): - print('Error: an equal amount of hosts, devices, weights, ' - 'and zones are required') - sys.exit(1) - - run_cmd(['/usr/bin/swift-ring-builder', - args.ring_file, - 'create', - args.part_power, - args.num_replicas, - args.min_part_hours]) - - for i in xrange(len(hosts)): - run_cmd(['/usr/bin/swift-ring-builder', - args.ring_file, - 'add', - 'z{}-{}/{}'.format(zones[i], hosts[i], devices[i]), - weights[i]]) - - run_cmd(['/usr/bin/swift-ring-builder', args.ring_file, 'rebalance']) - - -def main(): - args = setup_args() - run(args) - - -if __name__ == "__main__": - main() diff --git a/docker/common/swift/swift-base/config-swift.sh b/docker/common/swift/swift-base/config-swift.sh deleted file mode 100755 index b101b4e696..0000000000 --- a/docker/common/swift/swift-base/config-swift.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -chown -R swift: /srv/node diff --git a/docker/common/swift/swift-container-server/config-external.sh b/docker/common/swift/swift-container-server/config-external.sh deleted file mode 100644 index d81ba6cc41..0000000000 --- a/docker/common/swift/swift-container-server/config-external.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -OWNER="swift" - -if [[ -f "/opt/kolla/swift/swift.conf" ]]; then - cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf - chown ${OWNER}: /etc/swift/swift.conf - chmod 0640 /etc/swift/swift.conf -fi - -if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then - cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz - chown ${OWNER}: /etc/swift/container.ring.gz - chmod 0640 /etc/swift/container.ring.gz -fi - -if [[ -f "/opt/kolla/swift-container-server/container-server.conf" ]]; then - cp /opt/kolla/swift-container-server/container-server.conf /etc/swift/container-server.conf - chown ${OWNER}: /etc/swift/container-server.conf - chmod 0640 /etc/swift/container-server.conf -fi diff --git a/docker/common/swift/swift-container-server/start.sh b/docker/common/swift/swift-container-server/start.sh deleted file mode 100755 index 78070ab29c..0000000000 --- a/docker/common/swift/swift-container-server/start.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -o errexit - -CMD="/usr/bin/swift-container-server" -ARGS="/etc/swift/container-server.conf --verbose" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -source /opt/kolla/config-swift.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/swift/swift-object-auditor/config-external.sh b/docker/common/swift/swift-object-auditor/config-external.sh deleted file mode 100644 index 0fa02e9855..0000000000 --- a/docker/common/swift/swift-object-auditor/config-external.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" -TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" -OWNER="swift" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET -fi - -if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then - cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER - chown ${OWNER}: $TARGET_OBJECT_SERVER - chmod 0640 $TARGET_OBJECT_SERVER -fi diff --git a/docker/common/swift/swift-object-auditor/start.sh b/docker/common/swift/swift-object-auditor/start.sh deleted file mode 100755 index 6319eed6bd..0000000000 --- a/docker/common/swift/swift-object-auditor/start.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -o errexit - -CMD="/usr/bin/swift-object-auditor" -ARGS="/etc/swift/object-server.conf --verbose" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -source /opt/kolla/config-swift.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/swift/swift-object-base/config-swift-object.sh b/docker/common/swift/swift-object-base/config-swift-object.sh deleted file mode 100644 index 0d3d58dc39..0000000000 --- a/docker/common/swift/swift-object-base/config-swift-object.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -. /opt/kolla/kolla-common.sh - -check_required_vars \ - SWIFT_CONTAINER_SVC_RING_DEVICES \ - SWIFT_CONTAINER_SVC_RING_HOSTS \ - SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS \ - SWIFT_CONTAINER_SVC_RING_NAME \ - SWIFT_CONTAINER_SVC_RING_PART_POWER \ - SWIFT_CONTAINER_SVC_RING_REPLICAS \ - SWIFT_CONTAINER_SVC_RING_WEIGHTS \ - SWIFT_CONTAINER_SVC_RING_ZONES \ - SWIFT_DIR \ - SWIFT_OBJECT_SVC_BIND_IP \ - SWIFT_OBJECT_SVC_BIND_PORT \ - SWIFT_OBJECT_SVC_DEVICES \ - SWIFT_OBJECT_SVC_MOUNT_CHECK \ - SWIFT_OBJECT_SVC_PIPELINE \ - SWIFT_OBJECT_SVC_RING_DEVICES \ - SWIFT_OBJECT_SVC_RING_HOSTS \ - SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS \ - SWIFT_OBJECT_SVC_RING_NAME \ - SWIFT_OBJECT_SVC_RING_PART_POWER \ - SWIFT_OBJECT_SVC_RING_REPLICAS \ - SWIFT_OBJECT_SVC_RING_WEIGHTS \ - SWIFT_OBJECT_SVC_RING_ZONES \ - SWIFT_USER - -cfg=/etc/swift/object-server.conf - -crudini --set $cfg DEFAULT bind_ip "${SWIFT_OBJECT_SVC_BIND_IP}" -crudini --set $cfg DEFAULT bind_port "${SWIFT_OBJECT_SVC_BIND_PORT}" -crudini --set $cfg DEFAULT user "${SWIFT_USER}" -crudini --set $cfg DEFAULT swift_dir "${SWIFT_DIR}" -crudini --set $cfg DEFAULT devices "${SWIFT_OBJECT_SVC_DEVICES}" -crudini --set $cfg DEFAULT mount_check "${SWIFT_OBJECT_SVC_MOUNT_CHECK}" - -crudini --set $cfg pipeline:main pipeline "${SWIFT_OBJECT_SVC_PIPELINE}" - -# NOTE(pbourke): some services require a section in the conf, even if empty -crudini --set $cfg object-expirer - -# Create swift user and group if they don't exist -id -u swift &>/dev/null || useradd --user-group swift - -# Ensure proper ownership of the mount point directory structure -chown -R swift:swift /srv/node - -# TODO(pbourke): does this need to be on a data vol? -mkdir -p /var/cache/swift -chown -R swift:swift /var/cache/swift - -python /opt/kolla/build-swift-ring.py \ - -f ${SWIFT_OBJECT_SVC_RING_NAME} \ - -p ${SWIFT_OBJECT_SVC_RING_PART_POWER} \ - -r ${SWIFT_OBJECT_SVC_RING_REPLICAS} \ - -m ${SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS} \ - -H ${SWIFT_OBJECT_SVC_RING_HOSTS} \ - -w ${SWIFT_OBJECT_SVC_RING_WEIGHTS} \ - -d ${SWIFT_OBJECT_SVC_RING_DEVICES} \ - -z ${SWIFT_OBJECT_SVC_RING_ZONES} - -python /opt/kolla/build-swift-ring.py \ - -f ${SWIFT_CONTAINER_SVC_RING_NAME} \ - -p ${SWIFT_CONTAINER_SVC_RING_PART_POWER} \ - -r ${SWIFT_CONTAINER_SVC_RING_REPLICAS} \ - -m ${SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS} \ - -H ${SWIFT_CONTAINER_SVC_RING_HOSTS} \ - -w ${SWIFT_CONTAINER_SVC_RING_WEIGHTS} \ - -d ${SWIFT_CONTAINER_SVC_RING_DEVICES} \ - -z ${SWIFT_CONTAINER_SVC_RING_ZONES} diff --git a/docker/common/swift/swift-object-expirer/config-external.sh b/docker/common/swift/swift-object-expirer/config-external.sh deleted file mode 100644 index ff2bcf9f5f..0000000000 --- a/docker/common/swift/swift-object-expirer/config-external.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_OBJECT_EXPIRER="/opt/kolla/swift/object-expirer.conf" -TARGET_OBJECT_EXPIRER="/etc/swift/object-expirer.conf" -OWNER="swift" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET -fi - -if [[ -f "$SOURCE_OBJECT_EXPIRER" ]]; then - cp $SOURCE_OBJECT_EXPIRER $TARGET_OBJECT_EXPIRER - chown ${OWNER}: $TARGET_OBJECT_EXPIRER - chmod 0640 $TARGET_OBJECT_EXPIRER -fi diff --git a/docker/common/swift/swift-object-expirer/start.sh b/docker/common/swift/swift-object-expirer/start.sh deleted file mode 100755 index 434e8dc499..0000000000 --- a/docker/common/swift/swift-object-expirer/start.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -o errexit - -CMD="/usr/bin/swift-object-expirer" -ARGS="/etc/swift/object-server.conf --verbose" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -source /opt/kolla/config-swift.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/swift/swift-object-replicator/config-external.sh b/docker/common/swift/swift-object-replicator/config-external.sh deleted file mode 100644 index 0fa02e9855..0000000000 --- a/docker/common/swift/swift-object-replicator/config-external.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" -TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" -OWNER="swift" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET -fi - -if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then - cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER - chown ${OWNER}: $TARGET_OBJECT_SERVER - chmod 0640 $TARGET_OBJECT_SERVER -fi diff --git a/docker/common/swift/swift-object-replicator/start.sh b/docker/common/swift/swift-object-replicator/start.sh deleted file mode 100755 index 203f8864d1..0000000000 --- a/docker/common/swift/swift-object-replicator/start.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -o errexit - -CMD="/usr/bin/swift-object-replicator" -ARGS="/etc/swift/object-server.conf --verbose" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -source /opt/kolla/config-swift.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/swift/swift-object-server/config-external.sh b/docker/common/swift/swift-object-server/config-external.sh deleted file mode 100644 index a3fb1a2cc5..0000000000 --- a/docker/common/swift/swift-object-server/config-external.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -OWNER="swift" - -if [[ -f "/opt/kolla/swift/swift.conf" ]]; then - cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf - chown ${OWNER}: /etc/swift/swift.conf - chmod 0640 /etc/swift/swift.conf -fi - -if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then - cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz - chown ${OWNER}: /etc/swift/object.ring.gz - chmod 0640 /etc/swift/object.ring.gz -fi - -if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then - cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz - chown ${OWNER}: /etc/swift/container.ring.gz - chmod 0640 /etc/swift/container.ring.gz -fi - -if [[ -f "/opt/kolla/swift-object-server/object-server.conf" ]]; then - cp /opt/kolla/swift-object-server/object-server.conf /etc/swift/object-server.conf - chown ${OWNER}: /etc/swift/object-server.conf - chmod 0640 /etc/swift/object-server.conf -fi diff --git a/docker/common/swift/swift-object-server/start.sh b/docker/common/swift/swift-object-server/start.sh deleted file mode 100755 index f2a32b4d37..0000000000 --- a/docker/common/swift/swift-object-server/start.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -o errexit - -CMD="/usr/bin/swift-object-server" -ARGS="/etc/swift/object-server.conf --verbose" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -source /opt/kolla/config-swift.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/swift/swift-object-updater/config-external.sh b/docker/common/swift/swift-object-updater/config-external.sh deleted file mode 100644 index 0fa02e9855..0000000000 --- a/docker/common/swift/swift-object-updater/config-external.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" -TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" -OWNER="swift" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET -fi - -if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then - cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER - chown ${OWNER}: $TARGET_OBJECT_SERVER - chmod 0640 $TARGET_OBJECT_SERVER -fi diff --git a/docker/common/swift/swift-object-updater/start.sh b/docker/common/swift/swift-object-updater/start.sh deleted file mode 100755 index 744344f74c..0000000000 --- a/docker/common/swift/swift-object-updater/start.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -o errexit - -CMD="/usr/bin/swift-object-updater" -ARGS="/etc/swift/object-server.conf --verbose" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -source /opt/kolla/config-swift.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/swift/swift-proxy-server/config-external.sh b/docker/common/swift/swift-proxy-server/config-external.sh deleted file mode 100755 index 434cce7e5f..0000000000 --- a/docker/common/swift/swift-proxy-server/config-external.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -OWNER="swift" - -if [[ -f "/opt/kolla/swift/swift.conf" ]]; then - cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf - chown ${OWNER}: /etc/swift/swift.conf - chmod 0640 /etc/swift/swift.conf -fi - -if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then - cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz - chown ${OWNER}: /etc/swift/object.ring.gz - chmod 0640 /etc/swift/object.ring.gz -fi - -if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then - cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz - chown ${OWNER}: /etc/swift/container.ring.gz - chmod 0640 /etc/swift/container.ring.gz -fi - -if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then - cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz - chown ${OWNER}: /etc/swift/account.ring.gz - chmod 0640 /etc/swift/account.ring.gz -fi - -if [[ -f "/opt/kolla/swift-proxy-server/proxy-server.conf" ]]; then - cp /opt/kolla/swift-proxy-server/proxy-server.conf /etc/swift/proxy-server.conf - chown ${OWNER}: /etc/swift/proxy-server.conf - chmod 0640 /etc/swift/proxy-server.conf -fi diff --git a/docker/common/swift/swift-proxy-server/start.sh b/docker/common/swift/swift-proxy-server/start.sh deleted file mode 100755 index 99a142e526..0000000000 --- a/docker/common/swift/swift-proxy-server/start.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -o errexit - -CMD="/usr/bin/swift-proxy-server" -ARGS="/etc/swift/proxy-server.conf --verbose" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -source /opt/kolla/config-swift.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker_templates/swift/swift-account-server/config-external.sh b/docker_templates/swift/swift-account-server/config-external.sh deleted file mode 120000 index 2e64f572a8..0000000000 --- a/docker_templates/swift/swift-account-server/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-account-server/config-external.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-account-server/config-external.sh b/docker_templates/swift/swift-account-server/config-external.sh new file mode 100644 index 0000000000..61adefcd06 --- /dev/null +++ b/docker_templates/swift/swift-account-server/config-external.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [[ -f /opt/kolla/swift/swift.conf ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/ + chown swift: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then + cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz + chown swift: /etc/swift/account.ring.gz + chmod 0640 /etc/swift/account.ring.gz +fi + +if [[ -f /opt/kolla/swift-account-server/account-server.conf ]]; then + cp /opt/kolla/swift-account-server/account-server.conf /etc/swift/ + chown swift: /etc/swift/account-server.conf + chmod 0640 /etc/swift/account-server.conf +fi diff --git a/docker_templates/swift/swift-account-server/start.sh b/docker_templates/swift/swift-account-server/start.sh deleted file mode 120000 index 6e17dfe7f1..0000000000 --- a/docker_templates/swift/swift-account-server/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-account-server/start.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-account-server/start.sh b/docker_templates/swift/swift-account-server/start.sh new file mode 100755 index 0000000000..402ee6f44f --- /dev/null +++ b/docker_templates/swift/swift-account-server/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-account-server" +ARGS="/etc/swift/account-server.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +source /opt/kolla/config-swift.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/swift/swift-base/build-swift-ring.py b/docker_templates/swift/swift-base/build-swift-ring.py deleted file mode 120000 index de9cab77c4..0000000000 --- a/docker_templates/swift/swift-base/build-swift-ring.py +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-base/build-swift-ring.py \ No newline at end of file diff --git a/docker_templates/swift/swift-base/build-swift-ring.py b/docker_templates/swift/swift-base/build-swift-ring.py new file mode 100644 index 0000000000..d7386392d9 --- /dev/null +++ b/docker_templates/swift/swift-base/build-swift-ring.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +# Copyright 2015 Paul Bourke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +This script is a simple wrapper used to create and rebalance Swift ring files. +""" + +import argparse +import subprocess +import sys + + +def setup_args(): + parser = argparse.ArgumentParser() + parser.add_argument("-f", "--ring-file", + required=True, + help="Path to ring file") + parser.add_argument("-p", "--part-power", + required=True, + help="Part power") + parser.add_argument("-r", "--num-replicas", + required=True, + help="Number of replicas") + parser.add_argument("-m", "--min-part-hours", + required=True, + help="Min part hours") + parser.add_argument("-H", "--hosts", + required=True, + help="Hosts in the ring, comma delimited") + parser.add_argument("-w", "--weights", + required=True, + help="Weight of each host, comma delimited") + parser.add_argument("-d", "--devices", + required=True, + help="Device on each host, comma delimited") + parser.add_argument("-z", "--zones", + required=True, + help="Zone of each host, comma delimited") + return parser.parse_args() + + +def run_cmd(cmd): + print(' '.join(cmd)) + subprocess.call(cmd) + + +def run(args): + hosts = args.hosts.split(',') + weights = args.weights.split(',') + zones = args.zones.split(',') + devices = args.devices.split(',') + if not (len(hosts) == len(weights) == len(zones) == len(devices)): + print('Error: an equal amount of hosts, devices, weights, ' + 'and zones are required') + sys.exit(1) + + run_cmd(['/usr/bin/swift-ring-builder', + args.ring_file, + 'create', + args.part_power, + args.num_replicas, + args.min_part_hours]) + + for i in xrange(len(hosts)): + run_cmd(['/usr/bin/swift-ring-builder', + args.ring_file, + 'add', + 'z{}-{}/{}'.format(zones[i], hosts[i], devices[i]), + weights[i]]) + + run_cmd(['/usr/bin/swift-ring-builder', args.ring_file, 'rebalance']) + + +def main(): + args = setup_args() + run(args) + + +if __name__ == "__main__": + main() diff --git a/docker_templates/swift/swift-base/config-swift.sh b/docker_templates/swift/swift-base/config-swift.sh deleted file mode 120000 index 571e3b9ee1..0000000000 --- a/docker_templates/swift/swift-base/config-swift.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-base/config-swift.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-base/config-swift.sh b/docker_templates/swift/swift-base/config-swift.sh new file mode 100755 index 0000000000..b101b4e696 --- /dev/null +++ b/docker_templates/swift/swift-base/config-swift.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +chown -R swift: /srv/node diff --git a/docker_templates/swift/swift-container-server/config-external.sh b/docker_templates/swift/swift-container-server/config-external.sh deleted file mode 120000 index 880a5ca0e8..0000000000 --- a/docker_templates/swift/swift-container-server/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-container-server/config-external.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-container-server/config-external.sh b/docker_templates/swift/swift-container-server/config-external.sh new file mode 100644 index 0000000000..d81ba6cc41 --- /dev/null +++ b/docker_templates/swift/swift-container-server/config-external.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +OWNER="swift" + +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift-container-server/container-server.conf" ]]; then + cp /opt/kolla/swift-container-server/container-server.conf /etc/swift/container-server.conf + chown ${OWNER}: /etc/swift/container-server.conf + chmod 0640 /etc/swift/container-server.conf +fi diff --git a/docker_templates/swift/swift-container-server/start.sh b/docker_templates/swift/swift-container-server/start.sh deleted file mode 120000 index bdce09ff9c..0000000000 --- a/docker_templates/swift/swift-container-server/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-container-server/start.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-container-server/start.sh b/docker_templates/swift/swift-container-server/start.sh new file mode 100755 index 0000000000..78070ab29c --- /dev/null +++ b/docker_templates/swift/swift-container-server/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-container-server" +ARGS="/etc/swift/container-server.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +source /opt/kolla/config-swift.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/swift/swift-object-auditor/config-external.sh b/docker_templates/swift/swift-object-auditor/config-external.sh deleted file mode 120000 index 600658a32f..0000000000 --- a/docker_templates/swift/swift-object-auditor/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-auditor/config-external.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-auditor/config-external.sh b/docker_templates/swift/swift-object-auditor/config-external.sh new file mode 100644 index 0000000000..0fa02e9855 --- /dev/null +++ b/docker_templates/swift/swift-object-auditor/config-external.sh @@ -0,0 +1,18 @@ +#!/bin/bash +SOURCE="/opt/kolla/swift/swift.conf" +TARGET="/etc/swift/swift.conf" +SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" +TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" +OWNER="swift" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0640 $TARGET +fi + +if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then + cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER + chown ${OWNER}: $TARGET_OBJECT_SERVER + chmod 0640 $TARGET_OBJECT_SERVER +fi diff --git a/docker_templates/swift/swift-object-auditor/start.sh b/docker_templates/swift/swift-object-auditor/start.sh deleted file mode 120000 index 3ec3642221..0000000000 --- a/docker_templates/swift/swift-object-auditor/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-auditor/start.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-auditor/start.sh b/docker_templates/swift/swift-object-auditor/start.sh new file mode 100755 index 0000000000..6319eed6bd --- /dev/null +++ b/docker_templates/swift/swift-object-auditor/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-object-auditor" +ARGS="/etc/swift/object-server.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +source /opt/kolla/config-swift.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/swift/swift-object-base/config-swift-object.sh b/docker_templates/swift/swift-object-base/config-swift-object.sh deleted file mode 120000 index 615227fb40..0000000000 --- a/docker_templates/swift/swift-object-base/config-swift-object.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-base/config-swift-object.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-base/config-swift-object.sh b/docker_templates/swift/swift-object-base/config-swift-object.sh new file mode 100644 index 0000000000..0d3d58dc39 --- /dev/null +++ b/docker_templates/swift/swift-object-base/config-swift-object.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +. /opt/kolla/kolla-common.sh + +check_required_vars \ + SWIFT_CONTAINER_SVC_RING_DEVICES \ + SWIFT_CONTAINER_SVC_RING_HOSTS \ + SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS \ + SWIFT_CONTAINER_SVC_RING_NAME \ + SWIFT_CONTAINER_SVC_RING_PART_POWER \ + SWIFT_CONTAINER_SVC_RING_REPLICAS \ + SWIFT_CONTAINER_SVC_RING_WEIGHTS \ + SWIFT_CONTAINER_SVC_RING_ZONES \ + SWIFT_DIR \ + SWIFT_OBJECT_SVC_BIND_IP \ + SWIFT_OBJECT_SVC_BIND_PORT \ + SWIFT_OBJECT_SVC_DEVICES \ + SWIFT_OBJECT_SVC_MOUNT_CHECK \ + SWIFT_OBJECT_SVC_PIPELINE \ + SWIFT_OBJECT_SVC_RING_DEVICES \ + SWIFT_OBJECT_SVC_RING_HOSTS \ + SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS \ + SWIFT_OBJECT_SVC_RING_NAME \ + SWIFT_OBJECT_SVC_RING_PART_POWER \ + SWIFT_OBJECT_SVC_RING_REPLICAS \ + SWIFT_OBJECT_SVC_RING_WEIGHTS \ + SWIFT_OBJECT_SVC_RING_ZONES \ + SWIFT_USER + +cfg=/etc/swift/object-server.conf + +crudini --set $cfg DEFAULT bind_ip "${SWIFT_OBJECT_SVC_BIND_IP}" +crudini --set $cfg DEFAULT bind_port "${SWIFT_OBJECT_SVC_BIND_PORT}" +crudini --set $cfg DEFAULT user "${SWIFT_USER}" +crudini --set $cfg DEFAULT swift_dir "${SWIFT_DIR}" +crudini --set $cfg DEFAULT devices "${SWIFT_OBJECT_SVC_DEVICES}" +crudini --set $cfg DEFAULT mount_check "${SWIFT_OBJECT_SVC_MOUNT_CHECK}" + +crudini --set $cfg pipeline:main pipeline "${SWIFT_OBJECT_SVC_PIPELINE}" + +# NOTE(pbourke): some services require a section in the conf, even if empty +crudini --set $cfg object-expirer + +# Create swift user and group if they don't exist +id -u swift &>/dev/null || useradd --user-group swift + +# Ensure proper ownership of the mount point directory structure +chown -R swift:swift /srv/node + +# TODO(pbourke): does this need to be on a data vol? +mkdir -p /var/cache/swift +chown -R swift:swift /var/cache/swift + +python /opt/kolla/build-swift-ring.py \ + -f ${SWIFT_OBJECT_SVC_RING_NAME} \ + -p ${SWIFT_OBJECT_SVC_RING_PART_POWER} \ + -r ${SWIFT_OBJECT_SVC_RING_REPLICAS} \ + -m ${SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS} \ + -H ${SWIFT_OBJECT_SVC_RING_HOSTS} \ + -w ${SWIFT_OBJECT_SVC_RING_WEIGHTS} \ + -d ${SWIFT_OBJECT_SVC_RING_DEVICES} \ + -z ${SWIFT_OBJECT_SVC_RING_ZONES} + +python /opt/kolla/build-swift-ring.py \ + -f ${SWIFT_CONTAINER_SVC_RING_NAME} \ + -p ${SWIFT_CONTAINER_SVC_RING_PART_POWER} \ + -r ${SWIFT_CONTAINER_SVC_RING_REPLICAS} \ + -m ${SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS} \ + -H ${SWIFT_CONTAINER_SVC_RING_HOSTS} \ + -w ${SWIFT_CONTAINER_SVC_RING_WEIGHTS} \ + -d ${SWIFT_CONTAINER_SVC_RING_DEVICES} \ + -z ${SWIFT_CONTAINER_SVC_RING_ZONES} diff --git a/docker_templates/swift/swift-object-expirer/config-external.sh b/docker_templates/swift/swift-object-expirer/config-external.sh deleted file mode 120000 index 5ddb51de9a..0000000000 --- a/docker_templates/swift/swift-object-expirer/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-expirer/config-external.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-expirer/config-external.sh b/docker_templates/swift/swift-object-expirer/config-external.sh new file mode 100644 index 0000000000..ff2bcf9f5f --- /dev/null +++ b/docker_templates/swift/swift-object-expirer/config-external.sh @@ -0,0 +1,18 @@ +#!/bin/bash +SOURCE="/opt/kolla/swift/swift.conf" +TARGET="/etc/swift/swift.conf" +SOURCE_OBJECT_EXPIRER="/opt/kolla/swift/object-expirer.conf" +TARGET_OBJECT_EXPIRER="/etc/swift/object-expirer.conf" +OWNER="swift" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0640 $TARGET +fi + +if [[ -f "$SOURCE_OBJECT_EXPIRER" ]]; then + cp $SOURCE_OBJECT_EXPIRER $TARGET_OBJECT_EXPIRER + chown ${OWNER}: $TARGET_OBJECT_EXPIRER + chmod 0640 $TARGET_OBJECT_EXPIRER +fi diff --git a/docker_templates/swift/swift-object-expirer/start.sh b/docker_templates/swift/swift-object-expirer/start.sh deleted file mode 120000 index 14c430192d..0000000000 --- a/docker_templates/swift/swift-object-expirer/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-expirer/start.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-expirer/start.sh b/docker_templates/swift/swift-object-expirer/start.sh new file mode 100755 index 0000000000..434e8dc499 --- /dev/null +++ b/docker_templates/swift/swift-object-expirer/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-object-expirer" +ARGS="/etc/swift/object-server.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +source /opt/kolla/config-swift.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/swift/swift-object-replicator/config-external.sh b/docker_templates/swift/swift-object-replicator/config-external.sh deleted file mode 120000 index a38035ba22..0000000000 --- a/docker_templates/swift/swift-object-replicator/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-replicator/config-external.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-replicator/config-external.sh b/docker_templates/swift/swift-object-replicator/config-external.sh new file mode 100644 index 0000000000..0fa02e9855 --- /dev/null +++ b/docker_templates/swift/swift-object-replicator/config-external.sh @@ -0,0 +1,18 @@ +#!/bin/bash +SOURCE="/opt/kolla/swift/swift.conf" +TARGET="/etc/swift/swift.conf" +SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" +TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" +OWNER="swift" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0640 $TARGET +fi + +if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then + cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER + chown ${OWNER}: $TARGET_OBJECT_SERVER + chmod 0640 $TARGET_OBJECT_SERVER +fi diff --git a/docker_templates/swift/swift-object-replicator/start.sh b/docker_templates/swift/swift-object-replicator/start.sh deleted file mode 120000 index bd47778bec..0000000000 --- a/docker_templates/swift/swift-object-replicator/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-replicator/start.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-replicator/start.sh b/docker_templates/swift/swift-object-replicator/start.sh new file mode 100755 index 0000000000..203f8864d1 --- /dev/null +++ b/docker_templates/swift/swift-object-replicator/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-object-replicator" +ARGS="/etc/swift/object-server.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +source /opt/kolla/config-swift.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/swift/swift-object-server/config-external.sh b/docker_templates/swift/swift-object-server/config-external.sh deleted file mode 120000 index b39b6afe5c..0000000000 --- a/docker_templates/swift/swift-object-server/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-server/config-external.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-server/config-external.sh b/docker_templates/swift/swift-object-server/config-external.sh new file mode 100644 index 0000000000..a3fb1a2cc5 --- /dev/null +++ b/docker_templates/swift/swift-object-server/config-external.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +OWNER="swift" + +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then + cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz + chown ${OWNER}: /etc/swift/object.ring.gz + chmod 0640 /etc/swift/object.ring.gz +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift-object-server/object-server.conf" ]]; then + cp /opt/kolla/swift-object-server/object-server.conf /etc/swift/object-server.conf + chown ${OWNER}: /etc/swift/object-server.conf + chmod 0640 /etc/swift/object-server.conf +fi diff --git a/docker_templates/swift/swift-object-server/start.sh b/docker_templates/swift/swift-object-server/start.sh deleted file mode 120000 index 97c98b6faf..0000000000 --- a/docker_templates/swift/swift-object-server/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-server/start.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-server/start.sh b/docker_templates/swift/swift-object-server/start.sh new file mode 100755 index 0000000000..f2a32b4d37 --- /dev/null +++ b/docker_templates/swift/swift-object-server/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-object-server" +ARGS="/etc/swift/object-server.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +source /opt/kolla/config-swift.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/swift/swift-object-updater/config-external.sh b/docker_templates/swift/swift-object-updater/config-external.sh deleted file mode 120000 index c1ebd68089..0000000000 --- a/docker_templates/swift/swift-object-updater/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-updater/config-external.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-updater/config-external.sh b/docker_templates/swift/swift-object-updater/config-external.sh new file mode 100644 index 0000000000..0fa02e9855 --- /dev/null +++ b/docker_templates/swift/swift-object-updater/config-external.sh @@ -0,0 +1,18 @@ +#!/bin/bash +SOURCE="/opt/kolla/swift/swift.conf" +TARGET="/etc/swift/swift.conf" +SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" +TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" +OWNER="swift" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0640 $TARGET +fi + +if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then + cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER + chown ${OWNER}: $TARGET_OBJECT_SERVER + chmod 0640 $TARGET_OBJECT_SERVER +fi diff --git a/docker_templates/swift/swift-object-updater/start.sh b/docker_templates/swift/swift-object-updater/start.sh deleted file mode 120000 index b0455b774e..0000000000 --- a/docker_templates/swift/swift-object-updater/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-object-updater/start.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-object-updater/start.sh b/docker_templates/swift/swift-object-updater/start.sh new file mode 100755 index 0000000000..744344f74c --- /dev/null +++ b/docker_templates/swift/swift-object-updater/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-object-updater" +ARGS="/etc/swift/object-server.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +source /opt/kolla/config-swift.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/swift/swift-proxy-server/config-external.sh b/docker_templates/swift/swift-proxy-server/config-external.sh deleted file mode 120000 index 9bb7410f47..0000000000 --- a/docker_templates/swift/swift-proxy-server/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-proxy-server/config-external.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-proxy-server/config-external.sh b/docker_templates/swift/swift-proxy-server/config-external.sh new file mode 100755 index 0000000000..434cce7e5f --- /dev/null +++ b/docker_templates/swift/swift-proxy-server/config-external.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +OWNER="swift" + +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then + cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz + chown ${OWNER}: /etc/swift/object.ring.gz + chmod 0640 /etc/swift/object.ring.gz +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then + cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz + chown ${OWNER}: /etc/swift/account.ring.gz + chmod 0640 /etc/swift/account.ring.gz +fi + +if [[ -f "/opt/kolla/swift-proxy-server/proxy-server.conf" ]]; then + cp /opt/kolla/swift-proxy-server/proxy-server.conf /etc/swift/proxy-server.conf + chown ${OWNER}: /etc/swift/proxy-server.conf + chmod 0640 /etc/swift/proxy-server.conf +fi diff --git a/docker_templates/swift/swift-proxy-server/start.sh b/docker_templates/swift/swift-proxy-server/start.sh deleted file mode 120000 index be2f8abef2..0000000000 --- a/docker_templates/swift/swift-proxy-server/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/swift/swift-proxy-server/start.sh \ No newline at end of file diff --git a/docker_templates/swift/swift-proxy-server/start.sh b/docker_templates/swift/swift-proxy-server/start.sh new file mode 100755 index 0000000000..99a142e526 --- /dev/null +++ b/docker_templates/swift/swift-proxy-server/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-proxy-server" +ARGS="/etc/swift/proxy-server.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +source /opt/kolla/config-swift.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS