From 860469e2f6f4aa9ba0d4f09ea77c5d14fa391b9e Mon Sep 17 00:00:00 2001 From: Henri Rosten Date: Thu, 29 Feb 2024 14:40:01 +0200 Subject: [PATCH] caddy: Move caddy environment file Move caddy environment file from `/run/caddy.env` to `/var/lib/caddy/caddy.env` to make it persist reboots. Before this change, caddy service would fail to start after the first boot due to missing caddy environment file. Signed-off-by: Henri Rosten --- hosts/azure/binary-cache/configuration.nix | 2 +- hosts/azure/jenkins-controller/configuration.nix | 2 +- terraform/binary-cache.tf | 2 +- terraform/jenkins-controller.tf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hosts/azure/binary-cache/configuration.nix b/hosts/azure/binary-cache/configuration.nix index 6046577a..dec1154b 100644 --- a/hosts/azure/binary-cache/configuration.nix +++ b/hosts/azure/binary-cache/configuration.nix @@ -88,7 +88,7 @@ "" "${pkgs.caddy}/bin/caddy run --environ --config ${config.services.caddy.configFile}/Caddyfile" ]; - systemd.services.caddy.serviceConfig.EnvironmentFile = "/run/caddy.env"; + systemd.services.caddy.serviceConfig.EnvironmentFile = "/var/lib/caddy/caddy.env"; # Wait for cloud-init mounting before we start caddy. systemd.services.caddy.after = ["cloud-init.service"]; diff --git a/hosts/azure/jenkins-controller/configuration.nix b/hosts/azure/jenkins-controller/configuration.nix index 446805f4..6ed118e4 100644 --- a/hosts/azure/jenkins-controller/configuration.nix +++ b/hosts/azure/jenkins-controller/configuration.nix @@ -348,7 +348,7 @@ in { "" "${pkgs.caddy}/bin/caddy run --environ --config ${config.services.caddy.configFile}/Caddyfile" ]; - systemd.services.caddy.serviceConfig.EnvironmentFile = "/run/caddy.env"; + systemd.services.caddy.serviceConfig.EnvironmentFile = "/var/lib/caddy/caddy.env"; # Wait for cloud-init mounting before we start caddy. systemd.services.caddy.after = ["cloud-init.service"]; diff --git a/terraform/binary-cache.tf b/terraform/binary-cache.tf index 34192e58..b310f3d2 100644 --- a/terraform/binary-cache.tf +++ b/terraform/binary-cache.tf @@ -40,7 +40,7 @@ module "binary_cache_vm" { }, { content = "SITE_ADDRESS=ghaf-binary-cache-${local.env}.northeurope.cloudapp.azure.com", - "path" = "/run/caddy.env" + "path" = "/var/lib/caddy/caddy.env" }, ], })]) diff --git a/terraform/jenkins-controller.tf b/terraform/jenkins-controller.tf index eb741e8e..874face0 100644 --- a/terraform/jenkins-controller.tf +++ b/terraform/jenkins-controller.tf @@ -65,7 +65,7 @@ module "jenkins_controller_vm" { }, { content = "SITE_ADDRESS=ghaf-jenkins-controller-${local.env}.northeurope.cloudapp.azure.com", - "path" = "/run/caddy.env" + "path" = "/var/lib/caddy/caddy.env" } ] })])