cyberark / summon

CLI that provides on-demand secrets access for common DevOps tools
https://cyberark.github.io/summon
MIT License
705 stars 63 forks source link

Merge multiple secrets.yml going up #185

Closed raphink closed 3 years ago

raphink commented 3 years ago

When using --up, it would be useful to be able to use a hierarchy of files, from most precise (local) to most generic (going up).

This would allow for example to set a token for a forge for multiple directories, by placing a secrets.yml file up in the hierarchy.

Something like this:

├── proj1
│   └── secrets.yml       # Secrets specific to proj1
├── proj2
│   └── secrets.yml       # Secrets specific to proj2
└── secrets.yml            # Generic secrets applying to both proj1 and proj2
BradleyBoutcher commented 3 years ago

Hi @raphink ,

Can you clarify this request a bit? I'm not sure I understand the request fully.

From what I see, this is the feature you would like:

izgeri commented 3 years ago

@raphink I wonder if this could also be resolved by just copy/pasting the common section in your project-specific secrets.yml files? I know it's not as DRY that way, but I'm not sure we want to add the capability to aggregate config from multiple secrets.yml files to this project.

You could also have a single secrets.yml for all of your projects with:

common:
  COMMON_VAR1: !var /path/to/common/var1

project1:
  PROJECT_VAR1: !var /path/to/project1/var1

project2:
  PROJECT_VAR1: !var /path/to/project2/var1

Then you can invoke it using the --environment or -e flag - if you tell it to use -e project1 it will load the project1 and common vars. If you tell it to use -e project2 it will load the project2 and common vars.

izgeri commented 3 years ago

@raphink I'm going to close this feature request at this time. As currently describe, I think using a single secrets.yml file with environments defined is a better solution. Please feel free to submit a new issue / reopen if you have an alternate proposal to share.