Compare commits

...

4 commits

5 changed files with 17 additions and 9 deletions

View file

@ -11,12 +11,17 @@ in
}; };
}); });
services.consul = { services.consul = {
nodes.agent = [ "checkmate" "grail" "thunderskin" "VEGAS" "prophet" ]; nodes = {
nixos.agent = [ agent = [ "checkmate" "grail" "thunderskin" "VEGAS" "prophet" ];
ready = config.services.consul.nodes.agent;
};
nixos = {
agent = [
./agent.nix ./agent.nix
./remote-api.nix ./remote-api.nix
./ready.nix
]; ];
ready = ./ready.nix;
};
}; };
dns.records."consul-remote.internal".consulService = "consul-remote"; dns.records."consul-remote.internal".consulService = "consul-remote";

View file

@ -42,8 +42,8 @@ in
{ {
systemd.services.consul-ready = { systemd.services.consul-ready = {
description = "Wait for Consul"; description = "Wait for Consul";
requires = [ "consul.service" ]; requires = lib.mkIf config.services.consul.enable [ "consul.service" ];
after = [ "consul.service" ]; after = lib.mkIf config.services.consul.enable [ "consul.service" ];
serviceConfig = { serviceConfig = {
ExecStart = lib.getExe consulReady; ExecStart = lib.getExe consulReady;
DynamicUser = true; DynamicUser = true;

View file

@ -1,4 +1,4 @@
{ testers, nixosModules, consul }: { testers, nixosModules, consul, cluster }:
let let
dataDir = { dataDir = {
@ -28,6 +28,7 @@ testers.runNixOSTest {
nixosModules.ascensions nixosModules.ascensions
nixosModules.systemd-extras nixosModules.systemd-extras
nixosModules.consul-distributed-services nixosModules.consul-distributed-services
cluster.config.services.consul.nixos.ready
]; ];
systemd.services = { systemd.services = {
create-file = { create-file = {

View file

@ -12,6 +12,7 @@ in
ascensions = pkgs.callPackage ./ascensions.nix { ascensions = pkgs.callPackage ./ascensions.nix {
inherit (self'.packages) consul; inherit (self'.packages) consul;
inherit (self) nixosModules; inherit (self) nixosModules;
inherit (config) cluster;
}; };
garage = pkgs.callPackage ./garage.nix { garage = pkgs.callPackage ./garage.nix {

View file

@ -22,6 +22,7 @@ testers.runNixOSTest {
nixosModules.port-magic 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
cluster.config.services.consul.nixos.ready
]; ];
options.services.locksmith.providers = lib.mkOption { options.services.locksmith.providers = lib.mkOption {
type = lib.types.raw; type = lib.types.raw;