You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can not override file_roots and pillar_roots with salt --config-dir option #25344
file_roots and pillar_roots are global master config options, and so are not affected by using -c with just a basic salt command. You must use -c with the salt-master command when starting the master. These config options also always require a master restart (as is expected, since they must be in place when the master is started).
Rather than use different file_roots and pillar_roots, why not just target different files within those directories? Just run salt '*' state.sls firstdir.test for firstdir/test.sls and salt '*' state.sls seconddir.test for seconddir/test.sls. You can also use environments and target the environment on the command line using salt '*' state.sls test saltenv=myenv.
Finally, you could compile different highstates into separate topfiles and use state.top to target the correct topfile.
That would be useful -- however, it's hard because of the salt architecture. Basically, the salt-cli fires off a command to the minions. The minions then run that command, reaching out to the master for any files they need. The master does not match requests from minions with running CLI jobs, and so has no ability to change the file_roots or similar on the fly in that manner. They have to be changed at master runtime.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Activity
basepi commentedon Jul 13, 2015
file_rootsandpillar_rootsare global master config options, and so are not affected by using-cwith just a basicsaltcommand. You must use-cwith thesalt-mastercommand when starting the master. These config options also always require a master restart (as is expected, since they must be in place when the master is started).Hope that helps!
MrCitron commentedon Jul 16, 2015
Thanks @basepi, actually this is not really helping as I still have no solution to use different versions of my states file when running
saltcommand.For now, I will limit my job to one execution at the same time to avoid mixing different versions of my state files during highstate.
Anyway, any advice regarding my need will be appreciated.
basepi commentedon Jul 23, 2015
Rather than use different file_roots and pillar_roots, why not just target different files within those directories? Just run
salt '*' state.sls firstdir.testforfirstdir/test.slsandsalt '*' state.sls seconddir.testforseconddir/test.sls. You can also use environments and target the environment on the command line usingsalt '*' state.sls test saltenv=myenv.Finally, you could compile different highstates into separate topfiles and use
state.topto target the correct topfile.redarqas commentedon Oct 13, 2015
It would be very useful to make
config-diroverride working with salt cli. Not making it global config option.basepi commentedon Oct 15, 2015
That would be useful -- however, it's hard because of the salt architecture. Basically, the salt-cli fires off a command to the minions. The minions then run that command, reaching out to the master for any files they need. The master does not match requests from minions with running CLI jobs, and so has no ability to change the file_roots or similar on the fly in that manner. They have to be changed at master runtime.
stale commentedon Jan 20, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.