-
Notifications
You must be signed in to change notification settings - Fork 42
SEP 25: Add runtime registers to salt #33
base: master
Are you sure you want to change the base?
Conversation
My first impression of this was that this would require a complete change to how we're processing states, because right now we render the templates and then process the states. But I see in your PR that your proposed uses different markers so it shouldn't do this. I'm pretty sure that this will require pretty significant changes to some of the ordering code, though you might be able to piggyback on the existing requisite system, since this is definitely adding another kind of requisite. I think that being able to get the results of one state in another would be pretty useful - though now that I'm thinking about it what about simply calling
Basically... if this approach is better or more robust than what we currently have, why? Can we show an example where it's clearly better because it's easier to write, faster, etc.? I'm not against this at all - but I think that it would be valuable for people to see how they can improve their Salt states by using this proposed feature. |
I proposed that these changes don't do that, do you think they need to? I can think of some scenarios where registers alter ordering -- decoupling states from each other maybe? But that's not really an issue I see in need of solving.
Does that cause the .sls file to be reevalueted midway through a highstate? I didn't think that was the case. What if you need the result of a previous state, such as needing to fetch a filename from a zip you extracted? That's possible using your approach? If so then yeah this is just a frustration born from a lack of clear documentation.
Fair enough, this is good feedback. I'll add more examples to the proposal. |
Hi @Timbus! I'd like to add this SEP to the Open Hour for this Thursday or next Thursday. Are you available to attend at 11am MT/5pm UTC on either day? You could present what's in the SEP and lead a discussion about it. Let me know if you're available. |
Hi, We're doing Ansible to Salt migration and the lack of any runtime variables logic was a huge problem for us. We looked at the slots but slots are a bit ugly and also they don't cover the "save" part, like when you save or register output to a variable and re-use it many times after. Runtime requisites help in for conditions but they also very naive right now although it will be improved in the next Salt release. The bottom line is: |
Just thought I'd add another datapoint: Yesterday I tried to disable some scheduled tasks that an installer enabled, as a post-install cleanup. In the end I used powershell with only_if (could also use |
So, I love this concept. One item I might consider The minor change to the setup would be to break register into a list of dicts something like
So in essence the code would in order
|
I proposed using 'nop' states to achieve that same effect because I felt it was clearer, though a little less terse.
I propose this because it avoids magic variables, and can have a much more easily defined set of behaviors, especially when combined with |
@Timbus still looking at this SEP and I was under the impression with it being "Chapter 1" that there might be more additions, but I may be assuming, there and do not mean to do so! We like where this going, and do not mean to rush it! I am clarifying since it is likely my blunder. |
I like this proposal as we have a use-case that requires such a 'global' information storage. The current implementation looks like this:
With a feature like the registers described in this proposal the cmd.run could be removed by writing the path into the register. |
This was discussed in the Open Hour on 2020-SEP-17 you can see all the details here: https://github.com/saltstack/community/wiki/Open-Hour-Agendas-and-Notes:-2020-09#salt-enhancement-proposal-sep-25-add-runtime-registers-to-salt and quoted here for clarity: Salt Enhancement Proposal (SEP) 25: Add runtime registers to SaltCommunity Manager Cassandra Faris
|
Sorry for being a bit lax here, it was a mix of not knowing if any progress was to be made, and being quite busy at my work.
To be honest, I was going to collect feedback and update the document while looking into the technical details + possible complications of any 'whatif' scenarios that popped up, but after my first POC and draft it all just seemed.. quite easy, thanks to jinja being able to handle most of the leg work. Were you, yourself, hoping for more functionality? Perhaps what is being lost is that I wanted this to be a global fix, hence it's a SEP. Not just state runs.. Orchestrations are quite lacking without vars imo, and thorium doesn't really know how to make use of its registers, which really kneecaps it.. But yeah I'm not changing how salt works in any fundamental way |
@Timbus that is ok! I wanted to make sure I wasn't making assumptions and I will get this assigned to someone to get more comments from the greater community. |
Any news about this feature? By now this is only one feature that ansible is winning in comparison. |
@Elufimov I have this on the Core Team's Friday meeting agenda to discuss and continue with next steps and more details will be coming soon. |
Any news? Maybe all actions take place somewhere else? |
Some nice person in irc pointed out this topic to me. I'm currently at a point where reading output from an orchestration really would make things easier. Looking forward to seeing this topic get some movement again. |
Apologies for the long hiatus, we're working to refocus on getting SEPs through the process. To summarize the current status: There has been a lot of discussion around the idea of runtime registers and that it could be cool. @whytewolf in particular is a fan, but nobody else on the core team has weighed in, and at least at one point there was a question if this was even proposing a significant change or something else. We probably need to take the time to grok this proposal. |
This SEP has reached final comment period |
The current sentiment is that we like the idea of this SEP but we have concerns about the details. Because of the magnitude of this kind of change, we really want a more comprehensive plan and maybe some PoC implementation to go with it. That would give us a lot more concrete ideas of how it's going to behave and interact with Salt. Unless something changes in the next ~week, we'll close this SEP as Abandoned (or Withdrawn) for now. One approach that could be a good idea is to form a working group to put together a more detailed SEP and PoC for this. |
I really like this idea and think I have a relatively easy way to achieve it with salt. Proof of concept to come. Stay tuned. |
So, for this proof of concept I did not concern myself with the jinja rendering, which will be essential, but it seems easy enough to add that in later so I didn't worry about it for now. The key concept I will demonstrate is that salt already allows data to persist for subsequent id blocks in a state thru the use of the The following is not necessarily intended to be a useful example, nor comprehensive, but illustrates the use of the concept of "registering" a variable for use in a subsequent state id block. The code used is located at my public repo here. See the following
For demonstration purposes, I have essentially wrapped
Again, this was for demo purposes as there may be other ways to achieve this with salt, however, since the precise user id a new user will be given is unknown until it occurs, I have demonstrated salt's ability to register this return to be used in a subsequent state. In practice, I imagine a new dunder added, e.g. To conclude, I have demonstrated, by purely altering the state modules themselves, we can achieve salt registers, with no fundamental changes. I do, however, realize that this task might be quite extensive, i.e. to retrofit all states, requisites, etc. Therefore, I defer to the salt core team to comment on whether this logic can be applied to the state runtime code itself. If it can, this would alleviate the task of applying this logic to all states, since altering the runtime would make it de-facto applied to all states, much like requisites. I'm eager to hear all of your thoughts. Cheers! 🍺 |
It's been over a year, any feedback from the core salt team? Coming from Ansible, orchestrations feel kind of useless without the this... |
No description provided.