Basic consul config.
This commit is contained in:
12
flake.lock
generated
12
flake.lock
generated
@@ -55,11 +55,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1687829761,
|
"lastModified": 1688482527,
|
||||||
"narHash": "sha256-QRe1Y8SS3M4GeC58F/6ajz6V0ZLUVWX3ZAMgov2N3/g=",
|
"narHash": "sha256-9zd0YC2gfsRvVJENZsVs1R5LBj5/t127JlCLggn/970=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9790f3242da2152d5aa1976e3e4b8b414f4dd206",
|
"rev": "c7a18f89ef1dc423f57f3de9bd5d9355550a5d15",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -71,11 +71,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1688049487,
|
"lastModified": 1688500189,
|
||||||
"narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=",
|
"narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9",
|
"rev": "78419edadf0fabbe5618643bd850b2f2198ed060",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./consul.nix
|
||||||
./impermanence.nix
|
./impermanence.nix
|
||||||
./nomad.nix
|
./nomad.nix
|
||||||
./seaweedfs.nix
|
./seaweedfs.nix
|
||||||
|
|||||||
@@ -1,8 +1,22 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
servers = [ "c1" "c2" "c3" ];
|
||||||
|
server_enabled = builtins.elem config.networking.hostName servers;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services.consul.enable = true;
|
services.consul = {
|
||||||
|
enable = true;
|
||||||
|
interface.advertise = "eno1";
|
||||||
|
extraConfig = {
|
||||||
|
datacenter = "alo";
|
||||||
|
server = server_enabled;
|
||||||
|
bootstrap_expect = (builtins.length servers + 2) / 2;
|
||||||
|
retry_join = builtins.filter (elem: elem != config.networking.hostName) servers;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [
|
||||||
|
"/var/lib/consul"
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
|
|||||||
Reference in New Issue
Block a user