6
0
Fork 0

Add --config flag to __prometheus_alertmanager

This commit is contained in:
Timothée Floure 2021-04-01 10:01:22 +02:00
parent 6957edfc1e
commit ead3a3637c
Signed by: tfloure
GPG key ID: 4502C902C00A1E12
2 changed files with 23 additions and 8 deletions

View file

@ -3,17 +3,31 @@
os="$(cat "${__global:?}/explorer/os")"
case "$os" in
alpine)
__package blackbox_exporter
require="__package/blackbox_exporter" __start_on_boot \
blackbox_exporter
require="__package/blackbox_exporter" __service \
blackbox_exporter --action start
;;
debian|ubuntu)
__package prometheus-blackbox-exporter
config=/etc/blackbox_exporter/blackbox.yml
package=blackbox_exporter
service="$package"
;;
*)
echo "This type does not supper $os. Exiting." >&2
exit 1
;;
esac
# Install software.
__package "$package"
require="__package/$package" __start_on_boot "$service"
require="__package/$package" __service "$service" --action start
if [ -f "${__object:?}/parameter/config" ]; then
if [ "$(cat "${__object:?}/parameter/config")" = "-" ]; then
user_config="${__object:?}/stdin"
else
user_config="${__object:?}/parameter/config"
fi
require="__package/$package" __file "$config" \
--source "$user_config" \
--mode 0644 \
--owner root \
--onchange "service $service restart"
fi

View file

@ -0,0 +1 @@
config