From 017238a1be6704b5c33aa8c2aff1bb1b038e5177 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 26 Mar 2022 19:04:52 +0200 Subject: [PATCH] fix(ops/oauth_proxy): Depend on Keycloak service If the Keycloak service is running on the same machine as the oauth2 proxy (spoiler alert: it is!), let the service depend on it. Change-Id: I30e4222b4cd5589e08849ef6f37cf1fb4369f55a Reviewed-on: https://cl.tvl.fyi/c/depot/+/5421 Tested-by: BuildkiteCI Autosubmit: tazjin Reviewed-by: sterni --- ops/modules/oauth2_proxy.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ops/modules/oauth2_proxy.nix b/ops/modules/oauth2_proxy.nix index 423f9010c..58b3a222a 100644 --- a/ops/modules/oauth2_proxy.nix +++ b/ops/modules/oauth2_proxy.nix @@ -19,6 +19,10 @@ let reverse_proxy = true set_xauthrequest = true ''; + + # Depend on the Keycloak service if it is running on the same + # machine. + depends_on = lib.optional config.services.keycloak.enable "keycloak.service"; in { options.services.depot.oauth2_proxy = { @@ -40,6 +44,8 @@ in config = lib.mkIf cfg.enable { systemd.services.oauth2_proxy = { inherit description; + after = depends_on; + wants = depends_on; wantedBy = [ "multi-user.target" ]; serviceConfig = {