[FEATURE REQUEST] Environment specific salt modules #67418
jtraub91
started this conversation in
Feature Requests
Replies: 2 comments 1 reply
-
Consider the following setup: Master and minion on a single VM.
Now after syncing modules, both environments will be synced because they are both defined in the top file
And thus only whichever module got cached last will be the one in use, even when specifying different saltenv during the state calls.
This feature request is suggesting to have salt use the correct module during each state call, respectively, based on the saltenv specified. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Have you tried something like that https://salt.tips/patching-salt-modules/#version-aware-override |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
Salt's fileserver has a concept of environments, which can work decently well to isolate different versions of states and other files to operate on minions under different circumstances. Salt even includes the ability to set the default saltenv and/or lock_saltenv in the minion config. However, one aspect in which this falls short is when you have custom modules in different environments. Currently the minion does not have a concept of a version of a module per environment, and is simply the last one synced to the minion's cache wins. This is especially strange, since salt supports and defaults to syncing modules from multiple environments via the saltutil.sync_modules command. This default behavior does not make sense in the scenario where different versions of modules of the same name exist in multiple environments. The problem is that this could prevent sharing masters / minions in the scenario where they are running jobs simultaneously with different modules for different "environments", in production or development scenarios.
Describe the solution you'd like
The solution to this could simply be to have a directory in the minion's module cache, per environment, that it would use based on the saltenv that is active for a given command.
Describe alternatives you've considered
There does not seem to be a way to allow for simultaneous executions on the same minion with different salt environments specified specifically when they are attempting to use different versions of the the same module in the different environments, due to the fact that only one can be cached on the minion at a single time.
Beta Was this translation helpful? Give feedback.
All reactions