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 <tazjin@tvl.su>
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-03-26 19:04:52 +02:00 committed by clbot
parent cc88081abf
commit 017238a1be

View file

@ -19,6 +19,10 @@ let
reverse_proxy = true reverse_proxy = true
set_xauthrequest = 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 in
{ {
options.services.depot.oauth2_proxy = { options.services.depot.oauth2_proxy = {
@ -40,6 +44,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.services.oauth2_proxy = { systemd.services.oauth2_proxy = {
inherit description; inherit description;
after = depends_on;
wants = depends_on;
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {