From 8fa96a1516c494dd39c3e575dce84b30e74d34a4 Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Thu, 3 Sep 2015 15:44:31 +0000 Subject: Add rsyncd image and related Ansible for Swift Swift replicator services require rsync to function. This patch adds a new container which is included automatically on each of the Swift storage nodes. Change-Id: If10fbe610ca4df21ef0f2c7a1025035d627cb4ba Partial-Bug: #1477993 --- docker/swift/swift-rsyncd/Dockerfile.j2 | 22 ++++++++++++++++++++++ docker/swift/swift-rsyncd/config-external.sh | 9 +++++++++ docker/swift/swift-rsyncd/start.sh | 14 ++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 docker/swift/swift-rsyncd/Dockerfile.j2 create mode 100644 docker/swift/swift-rsyncd/config-external.sh create mode 100755 docker/swift/swift-rsyncd/start.sh (limited to 'docker') diff --git a/docker/swift/swift-rsyncd/Dockerfile.j2 b/docker/swift/swift-rsyncd/Dockerfile.j2 new file mode 100644 index 000000000..b2f60a94e --- /dev/null +++ b/docker/swift/swift-rsyncd/Dockerfile.j2 @@ -0,0 +1,22 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %} + +RUN yum install -y rsync \ + && yum clean all + +{% elif base_distro in ['ubuntu', 'debian'] %} + +RUN apt-get install -y --no-install-recommends \ + rsync \ + && apt-get clean + +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] + +{{ include_footer }} diff --git a/docker/swift/swift-rsyncd/config-external.sh b/docker/swift/swift-rsyncd/config-external.sh new file mode 100644 index 000000000..3b3104272 --- /dev/null +++ b/docker/swift/swift-rsyncd/config-external.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +OWNER="swift" + +if [[ -f "/opt/kolla/swift-rsyncd/rsyncd.conf" ]]; then + cp /opt/kolla/swift-rsyncd/rsyncd.conf /etc/rsyncd.conf + chown ${OWNER}: /etc/rsyncd.conf + chmod 0640 /etc/rsyncd.conf +fi diff --git a/docker/swift/swift-rsyncd/start.sh b/docker/swift/swift-rsyncd/start.sh new file mode 100755 index 000000000..2267bb59f --- /dev/null +++ b/docker/swift/swift-rsyncd/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/rsync" +ARGS="--daemon --no-detach --config=/etc/rsyncd.conf" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS -- cgit v1.2.3