Compare commits

..

14 commits

2 changed files with 9 additions and 1 deletions

View file

@ -46,6 +46,9 @@ in
ScheduleShutdown st reboot ''${nextScheduledTime}000000
'';
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"
if [[ "$(realpath /run/booted-system/kernel)" != "$(realpath /nix/var/nix/profiles/system/kernel)" ]]; then
echo "Scheduling reboot for kernel upgrade"

View file

@ -19,6 +19,7 @@ testers.runNixOSTest {
nixosModules.ascensions
nixosModules.systemd-extras
nixosModules.consul-distributed-services
nixosModules.port-magic
cluster.config.services.storage.nixos.garage
cluster.config.services.storage.nixos.garageInternal
];
@ -26,6 +27,11 @@ testers.runNixOSTest {
type = lib.types.raw;
};
config = {
links.consulAgent = {
protocol = "http";
hostname = "consul";
port = 8500;
};
_module.args = {
depot.packages = { inherit garage; };
cluster.config = {
@ -41,7 +47,6 @@ testers.runNixOSTest {
environment.etc."dummy-secrets/garageRpcSecret".text = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
networking.firewall.allowedTCPPorts = [ 3901 8080 ];
services.garage = {
settings.consul_discovery.consul_http_addr = lib.mkForce "http://consul:8500";
layout.initial = lib.mkOverride 51 {
garage1 = { zone = "dc1"; capacity = 1000; };
garage2 = { zone = "dc1"; capacity = 1000; };