Some fixes regarding startup of postgres
Some checks failed
/ dev-shell (push) Successful in 2m5s
/ rust-packages (push) Successful in 9m2s
/ systems (push) Successful in 47m47s
/ terraform-providers (push) Successful in 7m45s
/ check (push) Failing after 11m24s

There were some issues with setting mount dependencies
for postgresql. Now however that is solved. What didn't work
was when the disk-mapping.json file depended on vault-agent.

As that file is not secret by any means, I moved it to /var/lib.

The only thing left to do, is to make postgresql start up
when the server is first created, and the /var/lib file
does not exist.
This commit is contained in:
Kaare Hoff Skovgaard 2025-08-11 00:13:57 +02:00
parent 1ca3a407f2
commit 0ff2b12fb0
Signed by: khs
GPG key ID: C7D890804F01E9F0
3 changed files with 42 additions and 6 deletions

View file

@ -51,6 +51,7 @@ in
khscodes.fs.zfs.zpools."${cfg.pool}".datasets."${cfg.datasetName}" = cfg.datasetConfig;
systemd.services.postgresql = {
after = [ "khscodes-zpool-setup.service" ];
requires = [ "khscodes-zpool-setup.service" ];
unitConfig = {
RequiresMountsFor = [ cfg.datasetConfig.mountpoint ];
};
@ -68,7 +69,10 @@ in
lib.lists.map (db: {
name = "postgresqlBackup-${db}";
value = {
after = [ "khscodes-zpool-setup.service" ];
after = [
"khscodes-zpool-setup.service"
];
requires = [ "khscodes-zpool-setup.service" ];
unitConfig = {
RequiresMountsFor = [ cfg.backupDatasetConfig.mountpoint ];
};