about summary refs log tree commit diff
path: root/ops/modules
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-03-26T17·04+0200
committerclbot <clbot@tvl.fyi>2022-03-31T13·27+0000
commit017238a1be6704b5c33aa8c2aff1bb1b038e5177 (patch)
tree914c502fff343e74729d4af772642fbc5ae738dd /ops/modules
parentcc88081abf1cd4de5d216cd5a12a1e5ff51b6d5e (diff)
fix(ops/oauth_proxy): Depend on Keycloak service r/3927
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 <tazjin@tvl.su>
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'ops/modules')
-rw-r--r--ops/modules/oauth2_proxy.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/ops/modules/oauth2_proxy.nix b/ops/modules/oauth2_proxy.nix
index 423f9010c5d2..58b3a222a80d 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 = {