-
-
Save meh/80585aa3c7e0077e9cd0ca499ec870f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileSystems = { | |
"/var/lib/postgresql" = { | |
device = "/dev/rbd0"; | |
fsType = "xfs"; | |
options = ["rw" "noauto" "x-systemd.automount"]; | |
}; | |
}; | |
systemd.automounts = [{ | |
where = "/var/lib/postgresql"; | |
requiredBy = ["postgresql.service"]; | |
requires = ["network-online.target" "rbd0.service"]; | |
}]; | |
systemd.services.rbd0 = { | |
description = "RADOS block device for PostgreSQL"; | |
requires = ["network-online.target"]; | |
conflicts = ["shutdown.target"]; | |
serviceConfig = { | |
Type = "oneshot"; | |
RemainAfterExit = "yes"; | |
ExecStart = "${pkgs.ceph-client}/bin/rbd --user postgres map postgres/data"; | |
ExecStop = "${pkgs.ceph-client}/bin/rbd unmap /dev/rbd0"; | |
}; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment