Browse Source

consul, changelog, consul agent => alpine

feature/support-type-deprecation
Nico Schottelius 3 years ago
parent
commit
21a16f5584
  1. 1
      cdist/conf/type/__consul/files/versions/1.5.0/cksum
  2. 1
      cdist/conf/type/__consul/files/versions/1.5.0/source
  3. 2
      cdist/conf/type/__consul/gencode-remote
  4. 3
      cdist/conf/type/__consul/manifest
  5. 38
      cdist/conf/type/__consul_agent/files/consul.sys-openrc
  6. 47
      cdist/conf/type/__consul_agent/manifest
  7. 5
      docs/changelog

1
cdist/conf/type/__consul/files/versions/1.5.0/cksum vendored

@ -0,0 +1 @@
886614099 103959898 consul

1
cdist/conf/type/__consul/files/versions/1.5.0/source vendored

@ -0,0 +1 @@
https://releases.hashicorp.com/consul/1.5.0/consul_1.5.0_linux_amd64.zip

2
cdist/conf/type/__consul/gencode-remote vendored

@ -42,7 +42,7 @@ source_file_name="${source##*/}"
cksum_should=$(cut -d' ' -f1,2 "$version_dir/cksum")
cat << eof
tmpdir=\$(mktemp -d --tmpdir="/tmp" "${__type##*/}.XXXXXXXXXX")
tmpdir=\$(mktemp -d -p /tmp "${__type##*/}.XXXXXXXXXX")
curl -s -L "$source" > "\$tmpdir/$source_file_name"
unzip -p "\$tmpdir/$source_file_name" > "${destination}.tmp"
rm -rf "\$tmpdir"

3
cdist/conf/type/__consul/manifest vendored

@ -24,7 +24,7 @@
os=$(cat "$__global/explorer/os")
case "$os" in
scientific|centos|redhat|ubuntu|debian|devuan|archlinux|gentoo)
alpine|scientific|centos|redhat|ubuntu|debian|devuan|archlinux|gentoo)
# any linux should work
:
;;
@ -47,6 +47,7 @@ fi
if [ -f "$__object/parameter/direct" ]; then
__package unzip
__package curl
else
__staged_file /usr/local/bin/consul \
--source "$(cat "$version_dir/source")" \

38
cdist/conf/type/__consul_agent/files/consul.sys-openrc vendored

@ -0,0 +1,38 @@
#!/sbin/openrc-run
# 2019 Nico Schottelius (nico-cdist at schottelius.org)
description="consul agent"
pidfile="${CONSUL_PIDFILE:-"/var/run/$RC_SVCNAME/pidfile"}"
command="${CONSUL_BINARY:-"/usr/local/bin/consul"}"
checkconfig() {
if [ ! -d /var/run/consul ] ; then
mkdir -p /var/run/consul || return 1
chown consul:consul /var/run/$NAME || return 1
chmod 2770 /var/run/$NAME || return 1
fi
}
start() {
need net
start-stop-daemon --start --quiet --oknodo \
--pidfile "$pidfile" --background \
--exec $command -- agent -pid-file="$pidfile" -config-dir /etc/consul/conf.d
}
start_pre() {
checkconfig
}
stop() {
if [ "${RC_CMD}" = "restart" ] ; then
checkconfig || return 1
fi
ebegin "Stopping $RC_SVCNAME"
start-stop-daemon --stop --exec "$command" \
--pidfile "$pidfile" --quiet
eend $?
}

47
cdist/conf/type/__consul_agent/manifest vendored

@ -1,7 +1,7 @@
#!/bin/sh -e
#
# 2015 Steven Armstrong (steven-cdist at armstrong.cc)
# 2015 Nico Schottelius (nico-cdist at schottelius.org)
# 2015-2019 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
@ -23,7 +23,7 @@
os=$(cat "$__global/explorer/os")
case "$os" in
scientific|centos|debian|devuan|redhat|ubuntu)
alpine|scientific|centos|debian|devuan|redhat|ubuntu)
# whitelist safeguard
:
;;
@ -181,22 +181,25 @@ init_upstart()
# Install init script to start on boot
case "$os" in
centos|redhat)
os_version="$(sed 's/[^0-9.]//g' "$__global/explorer/os_version")"
major_version="${os_version%%.*}"
case "$major_version" in
[456])
init_sysvinit redhat
;;
7)
init_systemd
;;
*)
echo "Unsupported CentOS/Redhat version: $os_version" >&2
exit 1
;;
esac
;;
alpine|devuan)
init_sysvinit debian
;;
centos|redhat)
os_version="$(sed 's/[^0-9.]//g' "$__global/explorer/os_version")"
major_version="${os_version%%.*}"
case "$major_version" in
[456])
init_sysvinit redhat
;;
7)
init_systemd
;;
*)
echo "Unsupported CentOS/Redhat version: $os_version" >&2
exit 1
;;
esac
;;
debian)
os_version=$(cat "$__global/explorer/os_version")
@ -214,13 +217,9 @@ case "$os" in
exit 1
;;
esac
;;
devuan)
init_sysvinit debian
;;
;;
ubuntu)
init_upstart
;;
;;
esac

5
docs/changelog

@ -1,6 +1,11 @@
Changelog
---------
next:
* Type __consul: Add alpine support (Nico Schottelius)
* Type __consul: Add version 1.5.0 (Nico Schottelius)
* Type __consul_agent: Add alpine support (Nico Schottelius)
5.0.2: 2019-05-17
* Type __package_apk: Fix @repo handling in explorer (Nico Schottelius)
* Type __postfix: Add alpine support (Nico Schottelius)

Loading…
Cancel
Save