Compare commits
14 commits
fa66b887b8
...
a871987fba
Author | SHA1 | Date | |
---|---|---|---|
a871987fba | |||
46969ad1f2 | |||
f29878a6c1 | |||
d699f0bcb5 | |||
9d1cec7cb3 | |||
c922615666 | |||
33264bf43b | |||
fa57c810c0 | |||
9aa1f29e24 | |||
d2ab37f3b1 | |||
725d71cd47 | |||
825efc9b29 | |||
5616f4887a | |||
52008b6f0a |
2 changed files with 9 additions and 1 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"
|
||||||
|
|
|
@ -19,6 +19,7 @@ testers.runNixOSTest {
|
||||||
nixosModules.ascensions
|
nixosModules.ascensions
|
||||||
nixosModules.systemd-extras
|
nixosModules.systemd-extras
|
||||||
nixosModules.consul-distributed-services
|
nixosModules.consul-distributed-services
|
||||||
|
nixosModules.port-magic
|
||||||
cluster.config.services.storage.nixos.garage
|
cluster.config.services.storage.nixos.garage
|
||||||
cluster.config.services.storage.nixos.garageInternal
|
cluster.config.services.storage.nixos.garageInternal
|
||||||
];
|
];
|
||||||
|
@ -26,6 +27,11 @@ testers.runNixOSTest {
|
||||||
type = lib.types.raw;
|
type = lib.types.raw;
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
|
links.consulAgent = {
|
||||||
|
protocol = "http";
|
||||||
|
hostname = "consul";
|
||||||
|
port = 8500;
|
||||||
|
};
|
||||||
_module.args = {
|
_module.args = {
|
||||||
depot.packages = { inherit garage; };
|
depot.packages = { inherit garage; };
|
||||||
cluster.config = {
|
cluster.config = {
|
||||||
|
@ -41,7 +47,6 @@ testers.runNixOSTest {
|
||||||
environment.etc."dummy-secrets/garageRpcSecret".text = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
environment.etc."dummy-secrets/garageRpcSecret".text = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||||
networking.firewall.allowedTCPPorts = [ 3901 8080 ];
|
networking.firewall.allowedTCPPorts = [ 3901 8080 ];
|
||||||
services.garage = {
|
services.garage = {
|
||||||
settings.consul_discovery.consul_http_addr = lib.mkForce "http://consul:8500";
|
|
||||||
layout.initial = lib.mkOverride 51 {
|
layout.initial = lib.mkOverride 51 {
|
||||||
garage1 = { zone = "dc1"; capacity = 1000; };
|
garage1 = { zone = "dc1"; capacity = 1000; };
|
||||||
garage2 = { zone = "dc1"; capacity = 1000; };
|
garage2 = { zone = "dc1"; capacity = 1000; };
|
||||||
|
|
Loading…
Add table
Reference in a new issue