From d47cef0006b93680a8b5b77772154d7644ebbcb5 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Tue, 20 Sep 2016 19:41:56 +0200 Subject: DOCKER + ANSIBLE == PAIN (also: graphite) 3 hours. THREE HOURS. The extra "Expose" statements are to workaround an issue introduced in Ansible 2.1 with the addition of the docker_* modules that replaces the "docker" module. THREEEEEEE HOURS. The graphite container is so far not ued for anything, but is provided to get things rolling. It does do persistent storage, but obviously not the way I originally wanted. Because persistent storage with docker is a pile of frozen piss. --- build/test/dummy-graphite.start | 9 +++++++++ build/test/gondul-collector-test.Dockerfile | 1 + build/test/gondul-graphite-test.Dockerfile | 13 +++++++++++++ build/test/gondul-snmp-test.Dockerfile | 1 + 4 files changed, 24 insertions(+) create mode 100755 build/test/dummy-graphite.start create mode 100644 build/test/gondul-graphite-test.Dockerfile (limited to 'build/test') diff --git a/build/test/dummy-graphite.start b/build/test/dummy-graphite.start new file mode 100755 index 0000000..992928e --- /dev/null +++ b/build/test/dummy-graphite.start @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +if [ ! -r /var/lib/graphite/graphite.db ]; then + graphite-manage migrate + graphite-manage createsuperuser --noinput --username=admin --email root@localhost.localdomain + chown -R _graphite:_graphite /var/lib/graphite/ +fi +service apache2 start +service carbon-cache start +while true; do sleep 10; done diff --git a/build/test/gondul-collector-test.Dockerfile b/build/test/gondul-collector-test.Dockerfile index 0af8f75..c778c24 100644 --- a/build/test/gondul-collector-test.Dockerfile +++ b/build/test/gondul-collector-test.Dockerfile @@ -15,3 +15,4 @@ RUN apt-get -y install \ perl-modules RUN mkdir -p /opt/gondul CMD /opt/gondul/collectors/ping.pl +EXPOSE 1111 diff --git a/build/test/gondul-graphite-test.Dockerfile b/build/test/gondul-graphite-test.Dockerfile new file mode 100644 index 0000000..5ac187e --- /dev/null +++ b/build/test/gondul-graphite-test.Dockerfile @@ -0,0 +1,13 @@ +FROM debian:jessie +RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y graphite-carbon graphite-web apache2 +RUN apt-get install -y libapache2-mod-wsgi +RUN cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available/graphite-web.conf +RUN a2ensite graphite-web +RUN a2dissite 000-default +RUN a2enmod wsgi +RUN sed -i 's/false/true/g' /etc/default/graphite-carbon +ADD build/test/dummy-graphite.start /dummy-graphite.start +EXPOSE 80 +EXPOSE 2003 +CMD /dummy-graphite.start +VOLUME /var/lib/graphite diff --git a/build/test/gondul-snmp-test.Dockerfile b/build/test/gondul-snmp-test.Dockerfile index a99a943..3491831 100644 --- a/build/test/gondul-snmp-test.Dockerfile +++ b/build/test/gondul-snmp-test.Dockerfile @@ -18,3 +18,4 @@ RUN apt-get -y install \ RUN mkdir -p /opt/gondul COPY build/test/snmpd.conf /etc/snmp/ CMD /opt/gondul/build/test/snmpfetch-misc.sh +EXPOSE 1111 -- cgit v1.2.3