scrape: migrate from krops to flakes
This commit is contained in:
parent
f29dacb173
commit
4b8353c011
|
@ -40,11 +40,11 @@
|
||||||
},
|
},
|
||||||
"secrets": {
|
"secrets": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1614993322,
|
"lastModified": 1614994700,
|
||||||
"narHash": "sha256-JcC7oPS8qCmk+abBGUzNvgV2B9XACcNSjc0pfX0ldoA=",
|
"narHash": "sha256-2QCQB+w1teVZT83kfDifE1uKvFgm1wEL+3OHYG2+gFI=",
|
||||||
"ref": "master",
|
"ref": "master",
|
||||||
"rev": "30c7719adc2615e87e3b38596384ecec24347883",
|
"rev": "abe64361305019ae7664d03fc29e1ac9faae2222",
|
||||||
"revCount": 81,
|
"revCount": 83,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@gitea.c3d2.de:2222/c3d2-admins/secrets.git"
|
"url": "ssh://git@gitea.c3d2.de:2222/c3d2-admins/secrets.git"
|
||||||
},
|
},
|
||||||
|
|
13
flake.nix
13
flake.nix
|
@ -67,6 +67,8 @@
|
||||||
freifunk-nixos-rebuild = mkDeploy "freifunk" "freifunk.core.zentralwerk.org";
|
freifunk-nixos-rebuild = mkDeploy "freifunk" "freifunk.core.zentralwerk.org";
|
||||||
|
|
||||||
matemat-nixos-rebuild = mkDeploy "matemat" hostRegistry.hosts.matemat.ip4;
|
matemat-nixos-rebuild = mkDeploy "matemat" hostRegistry.hosts.matemat.ip4;
|
||||||
|
|
||||||
|
scrape-nixos-rebuild = mkDeploy "scrape" hostRegistry.hosts.scrape.ip4;
|
||||||
});
|
});
|
||||||
|
|
||||||
nixosConfigurations = let
|
nixosConfigurations = let
|
||||||
|
@ -147,6 +149,17 @@
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scrape = nixosSystem' {
|
||||||
|
modules = [
|
||||||
|
./lib/lxc-container.nix
|
||||||
|
./hosts/containers/scrape
|
||||||
|
({ ... }: {
|
||||||
|
nixpkgs.overlays = [ secrets.overlays.scrape ];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules.c3d2 = import ./lib;
|
nixosModules.c3d2 = import ./lib;
|
||||||
|
|
|
@ -81,6 +81,10 @@ rec {
|
||||||
ip4 = "172.22.99.133";
|
ip4 = "172.22.99.133";
|
||||||
ip6 = "2a02:8106:208:5201:f82b:1bff:fedc:8572";
|
ip6 = "2a02:8106:208:5201:f82b:1bff:fedc:8572";
|
||||||
};
|
};
|
||||||
|
scrape = {
|
||||||
|
ip4 = "172.20.73.32";
|
||||||
|
ip6 = "2a02:8106:208:5282:e073:50ff:fef5:eb6e";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hqGlobal = builtins.attrNames hosts;
|
hqGlobal = builtins.attrNames hosts;
|
||||||
|
|
|
@ -3,25 +3,13 @@
|
||||||
let
|
let
|
||||||
freifunkNodes = {
|
freifunkNodes = {
|
||||||
"1139" = "10.200.4.120";
|
"1139" = "10.200.4.120";
|
||||||
"1487" = "10.200.5.213";
|
|
||||||
"1884" = "10.200.7.100";
|
"1884" = "10.200.7.100";
|
||||||
"1891" = "10.200.7.107";
|
"1891" = "10.200.7.107";
|
||||||
"1768" = "10.200.6.239";
|
|
||||||
"1176" = "10.200.7.80";
|
|
||||||
"1099" = "10.200.4.80";
|
"1099" = "10.200.4.80";
|
||||||
|
"1864" = "10.200.7.80";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = [
|
c3d2.isInHq = false;
|
||||||
(modulesPath + "/profiles/minimal.nix")
|
|
||||||
../../../lib
|
|
||||||
../../../lib/lxc-container.nix
|
|
||||||
../../../lib/shared.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
c3d2 = {
|
|
||||||
isInHq = false;
|
|
||||||
hq.interface = "eth0";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.hostName = "scrape";
|
networking.hostName = "scrape";
|
||||||
networking.interfaces.eth0.ipv4.addresses = [{
|
networking.interfaces.eth0.ipv4.addresses = [{
|
||||||
|
@ -35,16 +23,15 @@ in {
|
||||||
environment.systemPackages = [ pkgs.git ];
|
environment.systemPackages = [ pkgs.git ];
|
||||||
|
|
||||||
systemd.services = let
|
systemd.services = let
|
||||||
scrapers = import (builtins.fetchGit {
|
scrapers = import (pkgs.fetchgit {
|
||||||
url = "https://gitea.c3d2.de/astro/scrapers.git";
|
url = "https://gitea.c3d2.de/astro/scrapers.git";
|
||||||
|
rev = "77c864b4d7e1ef4075ed115b036791c75176bef7";
|
||||||
|
sha256 = "1rj4dyn89zqyfaiv2ffi6g4x86l2xfgybyy5hlvxzgcabwaxdjyh";
|
||||||
}) { inherit pkgs; };
|
}) { inherit pkgs; };
|
||||||
makeService = { script, host, user ? "", password ? "" }: {
|
makeService = { script, host, user ? "", password ? "" }: {
|
||||||
script =
|
script =
|
||||||
"${scrapers.${script}}/bin/${script} ${host} ${user} ${password}";
|
"${scrapers.${script}}/bin/${script} ${host} ${user} ${password}";
|
||||||
};
|
};
|
||||||
xeriLogin = import <secrets/hosts/scrape/xeri.nix>;
|
|
||||||
fhemLogin = import <secrets/hosts/scrape/fhem.nix>;
|
|
||||||
matematLogin = import <secrets/hosts/scrape/matemat.nix>;
|
|
||||||
makeNodeScraper = nodeId: {
|
makeNodeScraper = nodeId: {
|
||||||
name = "scrape-node${nodeId}";
|
name = "scrape-node${nodeId}";
|
||||||
value = makeService {
|
value = makeService {
|
||||||
|
@ -56,7 +43,7 @@ in {
|
||||||
scrape-xeri = makeService {
|
scrape-xeri = makeService {
|
||||||
script = "xerox";
|
script = "xerox";
|
||||||
host = "xeri.hq.c3d2.de";
|
host = "xeri.hq.c3d2.de";
|
||||||
inherit (xeriLogin) user password;
|
inherit (pkgs.scrape-xeri-login) user password;
|
||||||
};
|
};
|
||||||
scrape-roxi = makeService {
|
scrape-roxi = makeService {
|
||||||
script = "xerox";
|
script = "xerox";
|
||||||
|
@ -65,12 +52,12 @@ in {
|
||||||
scrape-fhem = makeService {
|
scrape-fhem = makeService {
|
||||||
script = "fhem";
|
script = "fhem";
|
||||||
host = "fhem.hq.c3d2.de";
|
host = "fhem.hq.c3d2.de";
|
||||||
inherit (fhemLogin) user password;
|
inherit (pkgs.scrape-fhem-login) user password;
|
||||||
};
|
};
|
||||||
scrape-matemat = makeService {
|
scrape-matemat = makeService {
|
||||||
script = "matemat";
|
script = "matemat";
|
||||||
host = "matemat.hq.c3d2.de";
|
host = "matemat.hq.c3d2.de";
|
||||||
inherit (matematLogin) user password;
|
inherit (pkgs.scrape-matemat-login) user password;
|
||||||
};
|
};
|
||||||
} // builtins.listToAttrs
|
} // builtins.listToAttrs
|
||||||
(map makeNodeScraper (builtins.attrNames freifunkNodes));
|
(map makeNodeScraper (builtins.attrNames freifunkNodes));
|
|
@ -22,7 +22,6 @@ let
|
||||||
target = "root@${host}";
|
target = "root@${host}";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
scrape = deployContainer "scrape" "172.20.73.32";
|
|
||||||
ledstripes = deployContainer "ledstripes" "172.22.99.168";
|
ledstripes = deployContainer "ledstripes" "172.22.99.168";
|
||||||
kibana = deployContainer "kibana" "172.20.73.44";
|
kibana = deployContainer "kibana" "172.20.73.44";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue