diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-08-26 10:53:37 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-08-26 10:53:37 +0000 |
| commit | f2e09fd8077daa39797fb5abc436caa57b151b72 (patch) | |
| tree | aee73c6144862bb5e211aafe6f105ac807aae39c /docker | |
| parent | 323523b95aad4d43b7d392b4853fd1b73106bc5e (diff) | |
| parent | 515cf2af687656d5b6660d1fbf5d6f83d43148a4 (diff) | |
| download | kolla-f2e09fd8077daa39797fb5abc436caa57b151b72.tar.gz kolla-f2e09fd8077daa39797fb5abc436caa57b151b72.zip | |
Merge "Implement Ansible role for Swift"
Diffstat (limited to 'docker')
13 files changed, 96 insertions, 50 deletions
diff --git a/docker/common/swift/swift-account-server/config-external.sh b/docker/common/swift/swift-account-server/config-external.sh index 613fd30f0..61adefcd0 100644 --- a/docker/common/swift/swift-account-server/config-external.sh +++ b/docker/common/swift/swift-account-server/config-external.sh @@ -1,18 +1,19 @@ #!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_ACCOUNT_SERVER="/opt/kolla/swift/account-server.conf" -TARGET_ACCOUNT_SERVER="/etc/swift/account-server.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/ + chown swift: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf fi -if [[ -f "$SOURCE_ACCOUNT_SERVER" ]]; then - cp $SOURCE_ACCOUNT_SERVER $TARGET_ACCOUNT_SERVER - chown ${OWNER}: $TARGET_ACCOUNT_SERVER - chmod 0640 $TARGET_ACCOUNT_SERVER +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 index 1c205cb26..402ee6f44 100755 --- a/docker/common/swift/swift-account-server/start.sh +++ b/docker/common/swift/swift-account-server/start.sh @@ -8,6 +8,8 @@ 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 diff --git a/docker/common/swift/swift-base/config-swift.sh b/docker/common/swift/swift-base/config-swift.sh index 343abdcec..b101b4e69 100755 --- a/docker/common/swift/swift-base/config-swift.sh +++ b/docker/common/swift/swift-base/config-swift.sh @@ -1,9 +1,3 @@ #!/bin/bash -. /opt/kolla/kolla-common.sh - -check_required_vars SWIFT_HASH_PATH_SUFFIX - -cfg=/etc/swift/swift.conf - -crudini --set $cfg swift-hash swift_hash_path_suffix "${SWIFT_HASH_PATH_SUFFIX}" +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 index 93f696349..d81ba6cc4 100644 --- a/docker/common/swift/swift-container-server/config-external.sh +++ b/docker/common/swift/swift-container-server/config-external.sh @@ -1,18 +1,21 @@ #!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_CONTAINER_SERVER="/opt/kolla/swift/container-server.conf" -TARGET_CONTAINER_SERVER="/etc/swift/container-server.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/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 "$SOURCE_CONTAINER_SERVER" ]]; then - cp $SOURCE_CONTAINER_SERVER $TARGET_CONTAINER_SERVER - chown ${OWNER}: $TARGET_CONTAINER_SERVER - chmod 0640 $TARGET_CONTAINER_SERVER +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 index 2c8977d50..78070ab29 100755 --- a/docker/common/swift/swift-container-server/start.sh +++ b/docker/common/swift/swift-container-server/start.sh @@ -8,6 +8,8 @@ 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 diff --git a/docker/common/swift/swift-object-auditor/start.sh b/docker/common/swift/swift-object-auditor/start.sh index 18978e703..6319eed6b 100755 --- a/docker/common/swift/swift-object-auditor/start.sh +++ b/docker/common/swift/swift-object-auditor/start.sh @@ -8,6 +8,8 @@ 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 diff --git a/docker/common/swift/swift-object-expirer/start.sh b/docker/common/swift/swift-object-expirer/start.sh index 3d073fcc2..434e8dc49 100755 --- a/docker/common/swift/swift-object-expirer/start.sh +++ b/docker/common/swift/swift-object-expirer/start.sh @@ -8,6 +8,8 @@ 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 diff --git a/docker/common/swift/swift-object-replicator/start.sh b/docker/common/swift/swift-object-replicator/start.sh index 409661c6f..203f8864d 100755 --- a/docker/common/swift/swift-object-replicator/start.sh +++ b/docker/common/swift/swift-object-replicator/start.sh @@ -8,6 +8,8 @@ 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 diff --git a/docker/common/swift/swift-object-server/config-external.sh b/docker/common/swift/swift-object-server/config-external.sh index 0fa02e985..a3fb1a2cc 100644 --- a/docker/common/swift/swift-object-server/config-external.sh +++ b/docker/common/swift/swift-object-server/config-external.sh @@ -1,18 +1,27 @@ #!/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 +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 "$SOURCE_OBJECT_SERVER" ]]; then - cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER - chown ${OWNER}: $TARGET_OBJECT_SERVER - chmod 0640 $TARGET_OBJECT_SERVER +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 index c5def0a7a..f2a32b4d3 100755 --- a/docker/common/swift/swift-object-server/start.sh +++ b/docker/common/swift/swift-object-server/start.sh @@ -8,6 +8,8 @@ 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 diff --git a/docker/common/swift/swift-object-updater/start.sh b/docker/common/swift/swift-object-updater/start.sh index d26485824..744344f74 100755 --- a/docker/common/swift/swift-object-updater/start.sh +++ b/docker/common/swift/swift-object-updater/start.sh @@ -8,6 +8,8 @@ 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 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 |
