hosts: optionally set CONSUL_HTTP_ADDR from /etc/consul.json
This commit is contained in:
parent
5616f4887a
commit
825efc9b29
1 changed files with 3 additions and 0 deletions
|
@ -46,6 +46,9 @@ in
|
||||||
ScheduleShutdown st reboot ''${nextScheduledTime}000000
|
ScheduleShutdown st reboot ''${nextScheduledTime}000000
|
||||||
'';
|
'';
|
||||||
in pkgs.writeShellScript "post-effect.sh" ''
|
in pkgs.writeShellScript "post-effect.sh" ''
|
||||||
|
if [[ -e /etc/consul.json ]]; then
|
||||||
|
export CONSUL_HTTP_ADDR="$(${pkgs.jq}/bin/jq -r < /etc/consul.json '"\(.addresses.http // "127.0.0.1"):\(.ports.http // 8500)"')"
|
||||||
|
fi
|
||||||
export PATH="${config.packages.consul}/bin:${pkgs.coreutils}/bin"
|
export PATH="${config.packages.consul}/bin:${pkgs.coreutils}/bin"
|
||||||
if [[ "$(realpath /run/booted-system/kernel)" != "$(realpath /nix/var/nix/profiles/system/kernel)" ]]; then
|
if [[ "$(realpath /run/booted-system/kernel)" != "$(realpath /nix/var/nix/profiles/system/kernel)" ]]; then
|
||||||
echo "Scheduling reboot for kernel upgrade"
|
echo "Scheduling reboot for kernel upgrade"
|
||||||
|
|
Loading…
Reference in a new issue