Unverified Commit 03b92499 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #202087 from Shawn8901/pve-load-credential

parents 62e7f55d 5ed08d83
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ let
    text = "default:";
  };

  computedConfigFile = "${if cfg.configFile == null then emptyConfigFile else cfg.configFile}";
  computedConfigFile = if cfg.configFile == null then emptyConfigFile else cfg.configFile;
in
{
  port = 9221;
@@ -100,6 +100,8 @@ in
  };
  serviceOpts = {
    serviceConfig = {
      DynamicUser = cfg.environmentFile == null;
      LoadCredential = "configFile:${computedConfigFile}";
      ExecStart = ''
        ${cfg.package}/bin/pve_exporter \
          --${if cfg.collectors.status == true then "" else "no-"}collector.status \
@@ -108,7 +110,7 @@ in
          --${if cfg.collectors.cluster == true then "" else "no-"}collector.cluster \
          --${if cfg.collectors.resources == true then "" else "no-"}collector.resources \
          --${if cfg.collectors.config == true then "" else "no-"}collector.config \
          ${computedConfigFile} \
          %d/configFile \
          ${toString cfg.port} ${cfg.listenAddress}
      '';
    } // optionalAttrs (cfg.environmentFile != null) {