summaryrefslogtreecommitdiff
path: root/docker/cron
diff options
context:
space:
mode:
authorÉric Lemoine <elemoine@mirantis.com>2016-03-04 12:01:55 +0100
committerÉric Lemoine <elemoine@mirantis.com>2016-03-09 13:53:55 +0100
commit32a4cadac9072d630146e0fb667aec146fcd186f (patch)
tree180815cf690259b4f5289a13573d1ae8847746e6 /docker/cron
parent241913cc8f0870b160c4cb1c3327022e0ad9dd4b (diff)
downloadkolla-32a4cadac9072d630146e0fb667aec146fcd186f.tar.gz
kolla-32a4cadac9072d630146e0fb667aec146fcd186f.zip
Add cron image and playbook
Add cron image and playbook for logrotate. The "common" Ansible playbook includes configuration files for logrotate. At this point the operator cannot customize/override the logrotate configuration. Closes-Bug: #1553244 Change-Id: Ic9fdda9a273c9ccd90502f0acc7614d2c7157dca
Diffstat (limited to 'docker/cron')
-rw-r--r--docker/cron/Dockerfile.j223
-rw-r--r--docker/cron/extend_start.sh7
2 files changed, 30 insertions, 0 deletions
diff --git a/docker/cron/Dockerfile.j2 b/docker/cron/Dockerfile.j2
new file mode 100644
index 000000000..fd7b53cd5
--- /dev/null
+++ b/docker/cron/Dockerfile.j2
@@ -0,0 +1,23 @@
+FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
+
+RUN yum -y install \
+ cronie \
+ logrotate \
+ && yum clean all
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ cron \
+ logrotate \
+ && apt-get clean
+
+{% endif %}
+
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
+
+{{ include_footer }}
diff --git a/docker/cron/extend_start.sh b/docker/cron/extend_start.sh
new file mode 100644
index 000000000..08efca96f
--- /dev/null
+++ b/docker/cron/extend_start.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# NOTE(elemoine): the cron daemon sends its logs to /dev/log. Heka's log socket
+# is at /var/lib/kolla/heka/log so we symlink /dev/log to that location.
+if [[ ! -h /dev/log ]]; then
+ ln -sf /var/lib/kolla/heka/log /dev/log
+fi