Skip to content

Commit

Permalink
allow vault-agent templates without command
Browse files Browse the repository at this point in the history
  • Loading branch information
manveru authored and johnalotoski committed Sep 24, 2021
1 parent 72c403e commit 2001de3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modules/vault-agent.nix
Expand Up @@ -9,7 +9,10 @@ let
default = name;
};
contents = lib.mkOption { type = lib.types.str; };
command = lib.mkOption { type = lib.types.str; };
command = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
};
};
});

Expand Down Expand Up @@ -83,7 +86,12 @@ in {
}];
};

templates = cfg.templates;
templates = lib.mapAttrs (name: value:
{
inherit (value) destination contents;
} // (lib.optionalAttrs (value.command != null) {
command = value.command;
})) cfg.templates;
} // (lib.optionalAttrs (builtins.length cfg.listener > 0) {
cache.use_auto_auth_token = cfg.cache.useAutoAuthToken;

Expand Down

0 comments on commit 2001de3

Please sign in to comment.