aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorPaul Bourke <paul.bourke@oracle.com>2015-09-03 15:44:31 +0000
committerPaul Bourke <paul.bourke@oracle.com>2015-09-07 12:16:35 +0000
commit8fa96a1516c494dd39c3e575dce84b30e74d34a4 (patch)
tree8b39b71bce15c2e269bd00561ba4cec8c222c6d5 /docker
parente569d80182256f98febe499f7259bcd8dc54d07d (diff)
downloadkolla-8fa96a1516c494dd39c3e575dce84b30e74d34a4.tar.gz
kolla-8fa96a1516c494dd39c3e575dce84b30e74d34a4.zip
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
Diffstat (limited to 'docker')
-rw-r--r--docker/swift/swift-rsyncd/Dockerfile.j222
-rw-r--r--docker/swift/swift-rsyncd/config-external.sh9
-rwxr-xr-xdocker/swift/swift-rsyncd/start.sh14
3 files changed, 45 insertions, 0 deletions
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