-
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
[FEATURE REQUEST] Run local SLS file automatically on reboot, without going masterless! #58928
Comments
You can run salt with an alternative config location, |
It might be, can you give me an example? I've never heard of -c alternate configs. I just need 1 sls file to run when the server powers back on, regardless of whether or not the minion can talk to the master. So I can't be doing any manual salt-call commands, not sure if that's a part of what you're getting at. It all has to happen automatically. Thanks again, Greg |
If you need to run such command on startup, then maybe it would be better not to force Salt to run it, but force Salt to configure actual startup script on your system? |
Yes, that is what I'll be doing if I can't find a smooth way for Salt to handle it entirely on its own. Thanks for your input, it reinforces what I am planning as a last resort. |
@evenyougreg to be honest, I've never thought of such usecase as yours, since SaltStack is mostly management configuration ;) (apart from other nice stuff of couse) When I wanted to configure something at start of system, I always used Salt to configure startup instead of making Salt of doing things like that. Mainly, because you can't rely on it always because - as you said - master may be unavailable. But managing startup script seems more Salty than actually executing |
Oh okay that's even easier then. You just need to run have the state.sls on your machine, then use state.template: Of course you'll need some way to run this command automatically at startup (perhaps every 'x' minutes is better). I suggest systemd on most linux machines, or the windows scheduled task manager. |
@evenyougreg We have a little utility package that we've been working on to support use-cases like this. We're using it pretty aggressively. See https://github.com/f0cal/saltbox |
@evenyougreg could use the salt module https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_task.html |
Thanks @cmcmarrow, I appreciate the input. I'm trying to avoid intervention/help outside of Salt software, which is why I was posting as a feature request. Seems like an obvious thing that could be built into Salt. |
Is your feature request related to a problem? Please describe.
My organization has a backup site failover issue that could be solved with Salt.
When our Windows minions failover to our backup site B, they are first powered down at site A, they then lose their original IP address and get a new one when they are powered back up at site B. In order to get back on the network and reconnect with the master and everything else they need "ipconfig /registerdns" ran.
Describe the solution you'd like
I am aware of masterless mode, but it turns off its ability and duty to talk to the master for instructions entirely, and goes totally headless.
What I need: When the server is powered back on and subsequently the salt agent is started, I need to run a local SLS file that runs "ipconfig /registerdns" with cmd.run, which will restore DNS and finally get everything it needs from the master. So I guess it's kind of a hybrid of local and remote working together?
Describe alternatives you've considered
I've tried different combinations of minion config file changes in hopes that the functionality is hidden in plain site, but I have struck out.
This is just one scenario, but I have many more situations that would benefit from this feature. Or, does it already exist and I'm just not seeing it?
Thanks in advance,
Greg
The text was updated successfully, but these errors were encountered: