import consul-template-0.16.0

This project provides a convenient way to populate values from Consul
into the file system using the consul-template daemon.

ok aja@
This commit is contained in:
jasper 2016-11-01 16:51:30 +00:00
parent 586c331a8d
commit 476d784cab
7 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# $OpenBSD: Makefile,v 1.1.1.1 2016/11/01 16:51:30 jasper Exp $
COMMENT= template rendering and notifications with Consul
GH_TAGNAME= v0.16.0
GH_ACCOUNT= hashicorp
GH_PROJECT= consul-template
CATEGORIES= sysutils net
HOMEPAGE= https://www.consul.io/
MAINTAINER= Jasper Lievisse Adriaanse <jasper@openbsd.org>
# MPLv2.0
PERMIT_PACKAGE_CDROM= Yes
WANTLIB += c pthread
MODULES= lang/go
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/consul-template
${INSTALL_DATA} ${WRKSRC}/examples/* ${FILESDIR}/default.conf \
${PREFIX}/share/examples/consul-template
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (consul-template-0.16.0.tar.gz) = wg4eVMMzuqix4DFxD3GlpTP/4HnWV3Y1Z0eKAhNE/1U=
SIZE (consul-template-0.16.0.tar.gz) = 2369947

View File

@ -0,0 +1,15 @@
# $OpenBSD: default.conf,v 1.1.1.1 2016/11/01 16:51:30 jasper Exp $
#
# Minimal configuration file for consul-template.
consul = "127.0.0.1:8500"
syslog {
enabled = true
facility = "DAEMON"
}
template {
source = "/path/to/template.ctmpl"
destination = "/path/to/destination"
}

View File

@ -0,0 +1,7 @@
This project provides a convenient way to populate values from Consul
into the file system using the consul-template daemon.
The daemon consul-template queries a Consul instance and updates any
number of specified templates on the file system. As an added bonus,
consul-template can optionally run arbitrary commands when the update
process completes.

View File

@ -0,0 +1,20 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2016/11/01 16:51:30 jasper Exp $
@newgroup _consul-template:781
@newuser _consul-template:781:_consul-template:daemon:Consul Template user:/nonexistent:/sbin/nologin
@bin bin/consul-template
share/doc/pkg-readmes/${FULLPKGNAME}
share/examples/consul-template/
share/examples/consul-template/apache.md
share/examples/consul-template/default.conf
@owner _consul-template
@group _consul-template
@sample ${SYSCONFDIR}/consul-template.d/
@sample ${SYSCONFDIR}/consul-template.d/default.conf
@owner
@group
share/examples/consul-template/haproxy.md
share/examples/consul-template/join.md
share/examples/consul-template/nginx.md
share/examples/consul-template/services.md
share/examples/consul-template/varnish.md
@rcscript ${RCDIR}/consul_template

View File

@ -0,0 +1,26 @@
$OpenBSD: README,v 1.1.1.1 2016/11/01 16:51:30 jasper Exp $
+-------------------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-------------------------------------------------------------------------------
Multiple instances
==================
By definition consul-template is meant to be ran with multiple instances. The
default `consul_template` uses ${SYSCONFDIR}/consul-template.d/default.conf .
In order to start multiple instances:
# ln -s ${RCDIR}/consul_template ${RCDIR}/consul_template_$NAME
# rcctl set consul_template_$NAME status on
# rcctl set consul_template_$NAME flags \
-config ${SYSCONFDIR}/consul-template.d/$NAME.conf
# rcctl start consul_template_$NAME
Configuration
=============
A default configuration file has been installed into
${SYSCONFDIR}/consul-template.d/default.conf . Please refer to the
the following https://github.com/hashicorp/consul-template#configuration-files
for more information on the configuration syntax.

View File

@ -0,0 +1,17 @@
#!/bin/sh
#
# $OpenBSD: consul_template.rc,v 1.1.1.1 2016/11/01 16:51:30 jasper Exp $
daemon="${PREFIX}/bin/consul-template"
daemon_flags="-config ${SYSCONFDIR}/consul-template.d/default.conf"
daemon_user="_consul-template"
. /etc/rc.d/rc.subr
rc_bg=YES
rc_stop() {
pkill -INT -T "${daemon_rtable}" -xf "${pexp}"
}
rc_cmd $1