From 515cf2af687656d5b6660d1fbf5d6f83d43148a4 Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Tue, 18 Aug 2015 14:05:54 +0000 Subject: Implement Ansible role for Swift This currently deploys the core services for a working Swift which are account/container/object/proxy. I've included some basic docs in docs/swift-related.rst, which gives usage instructions and more context on this patch. These are really to give an overview of the state of Swift in Kolla as of now, so unless there's some major inaccuracy there please don't nitpick it. Change-Id: Id0c54be3e24c46459c40b16b7020f05bddbe1b19 Implements: blueprint ansible-swift --- .../swift/swift-proxy-server/config-external.sh | 35 ++++++++++++++++++---- docker/common/swift/swift-proxy-server/start.sh | 2 ++ 2 files changed, 31 insertions(+), 6 deletions(-) (limited to 'docker/common/swift/swift-proxy-server') diff --git a/docker/common/swift/swift-proxy-server/config-external.sh b/docker/common/swift/swift-proxy-server/config-external.sh index 2b3327b33..434cce7e5 100755 --- a/docker/common/swift/swift-proxy-server/config-external.sh +++ b/docker/common/swift/swift-proxy-server/config-external.sh @@ -1,10 +1,33 @@ #!/bin/bash -SOURCE="/opt/kolla/swift-proxy-server/swift.conf" -TARGET="/etc/swift/swift.conf" + OWNER="swift" -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET +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 index da8bd088d..99a142e52 100755 --- a/docker/common/swift/swift-proxy-server/start.sh +++ b/docker/common/swift/swift-proxy-server/start.sh @@ -8,6 +8,8 @@ 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 -- cgit v1.2.3