]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/system/backup-2.nix
Add replication for redis
[perso/Immae/Config/Nix.git] / modules / private / system / backup-2.nix
index 1c5b7d84b383cebbd86a839c3872d5f1dd670d7c..3d51fa3bdaf2305fbf0b9bc4d2edde6060d4ec40 100644 (file)
@@ -3,6 +3,7 @@
 {
   boot.kernelPackages = pkgs.linuxPackages_latest;
   _module.args.privateFiles = privateFiles;
+  _module.args.hostFQDN = "backup-2.v.immae.eu";
   imports = builtins.attrValues (import ../..);
 
   deployment = {
@@ -48,6 +49,7 @@
     ssh_key_private = myconfig.env.rsync_backup.ssh_key.private;
   };
 
+  myServices.monitoring.enable = true;
   myServices.databasesReplication = {
     postgresql = {
       enable = true;
         };
       };
     };
+    mariadb = {
+      enable = true;
+      base = "/backup2";
+      hosts = {
+        eldiron = {
+          serverId = 2;
+          # mysql resolves "backup-2" host and checks the ip, but uses /etc/hosts which only contains ip4
+          host = myconfig.env.servers.eldiron.ips.main.ip4;
+          port = "3306";
+          user = "backup-2";
+          password = myconfig.env.ldap.backup-2.password;
+          dumpUser = "root";
+          dumpPassword = myconfig.env.databases.mysql.systemUsers.root;
+        };
+      };
+    };
+    redis = {
+      enable = true;
+      base = "/backup2";
+      hosts = {
+        eldiron = {
+          host = "127.0.0.1";
+          port = "16379";
+        };
+      };
+    };
   };
 
   # This value determines the NixOS release with which your system is