picard healthchecks
This commit is contained in:
parent
8d62eb3a63
commit
44e6454788
3 changed files with 15 additions and 0 deletions
|
|
@ -43,6 +43,7 @@
|
|||
services.postgresql.package = pkgs.postgresql_13;
|
||||
ragon.agenix.secrets."picardResticPassword" = { };
|
||||
ragon.agenix.secrets."picardResticSSHKey" = { };
|
||||
ragon.agenix.secrets."picardResticHealthCheckUrl" = { };
|
||||
|
||||
services.nginx.virtualHosts."xyno.space" = {
|
||||
enableACME = true;
|
||||
|
|
@ -69,6 +70,19 @@
|
|||
|
||||
};
|
||||
|
||||
|
||||
systemd.services.restic-backups-picard = {
|
||||
# ExecStartPost commands are only run if the ExecStart command succeeded
|
||||
serviceConfig.ExecStartPost = pkgs.writeShellScript "backupSuccessful" ''
|
||||
${pkgs.curl}/bin/curl -fss -m 10 --retry 5 -o /dev/null $(cat ${config.age.secrets.picardResticHealthCheckUrl.path})
|
||||
'';
|
||||
unitConfig.OnFailure = "backupFailure.service";
|
||||
};
|
||||
|
||||
systemd.services.backupFailure = {
|
||||
enable = true;
|
||||
script = "${pkgs.curl}/bin/curl -fss -m 10 --retry 5 -o /dev/null $(cat ${config.age.secrets.picardResticHealthCheckUrl.path})/fail";
|
||||
};
|
||||
ragon = {
|
||||
cli.enable = true;
|
||||
user.enable = true;
|
||||
|
|
|
|||
BIN
secrets/picardResticHealthCheckUrl.age
Normal file
BIN
secrets/picardResticHealthCheckUrl.age
Normal file
Binary file not shown.
|
|
@ -20,4 +20,5 @@ in
|
|||
"nextcloudAdminPass.age".publicKeys = pubkeys.ragon.host "picard";
|
||||
"picardResticSSHKey.age".publicKeys = pubkeys.ragon.host "picard";
|
||||
"picardResticPassword.age".publicKeys = pubkeys.ragon.host "picard";
|
||||
"picardResticHealthCheckUrl.age".publicKeys = pubkeys.ragon.host "picard";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue