-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new feature: add saltenv directory to file_roots and pillar_roots for dynamic environments #55747
Comments
@morgana2313 Seems like this would be a useful feature to have. Thanks! @saltstack/team-core Any addition questions or comments? |
I'm not very familiair with the Saltstack codebase, so this implementation probably suffers from some oversights. Features:
I tried to figure out how and when the |
Proposing another config syntax: file_roots:
__env__: /path_to_dir_with_multiple_environments/__env__ (i.e. file_roots:
__env__: /path_to_dir_with_multiple_environments/__env__/salt
pillar_roots:
__env__: /path_to_dir_with_multiple_environments/__env__/pillar However:
|
I agree that I tried your suggestion about the syntax, but got the feeling that caused a lot more code changes than my proposed optional dict route, but I may be mistaken about that. I think I have found the proper place for a similar option in |
I've made an implementation for the pillar_roots as well. I changed the config syntax to:
Using this optional dict config structure allows for future more powerfull config options as well. NB: This option is not limited to environments with an env entry in file_roots ans pillar_roots. It works for base just as well, although it's not useful then. How should I proceed? |
I can think of two different strategies to implement these dynamic saltenvs:
The consequence of strategy (2) is that the one |
I've added an implementation for dynamic environments for ext_pillar.stack as well:
|
@garethgreenaway, @sathieu:
|
@waynew assigning you as this is a good one for Test Clinic and cannot commit to a release schedule until tests are written, but thank you all for contributing what you have! |
closing with #61531. Thank you. |
#50784 from @sathieu as requested by @BenjaminSchiborr in #48132 allows for one (and only one I think?) default catch-all saltenv
__env__
in file_roots definitions that maps all saltenvs to a single directory.If the requestor's saltenv can be prepended to a requested file-path for a particular file_root entry this would allow for a roots variant of the gitfs, svnfs and hgfs behavior where branches and tags are translated into salt environments; salt environments are translated into directories. This allows for adding saltenvs dynamically without restarting the salt-master.
One might config this by setting a
append_saltenv
flag:#52392 from @mattp is about a similar subject: dynamic file roots that can be configured runtime via the utils/ LazyLoader mechanism without restarting the salt-master.
My proposed feature would imply that the salt-master perhaps doesn't even know about these saltenvs, but can find the requested file with the saltenv prepended to the file's path nevertheless.
A similar scheme would be needed for pillar_roots.
NB: The
__env__
forpillar_roots
is implemented in #46309. It is not mentioned in the master.conf documentation though.The text was updated successfully, but these errors were encountered: