saltstack / saltstack/salt

[FEATURE REQUEST] Support checking/modifying the return of state.module.run

Open
#58,114 16 comments 0 reactions 2 assignees View on GitHub

@dwoz is already working on this.

Since Aug 17, 2020.

Feature pending-discussion
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Problem
Today I was struggling to use the win_service.modify command from state.module.run in a way that would allow for some result-based followup actions. I ended up writing a custom state but I feel like it should have been possible without needing to use python.

Solution
If state.module.run offered an interface to allow for checking return values and using them to signal success/change/failure, I could have called win_service.info and checked the values, then chained the state using onchange.
Strangely enough, loop.until_no_eval seems to offer something like this with the compare operator? But it's hardly fit for purpose.

Alternatives + SEP thoughts
Guess I'll also mention that exploring through other options like slots (yuck), state.cmd+stateful, and most of the requisites, seems to show there is a need for runtime variable-passing and logical operators (yes like registers from ansible), and having such a system would probably simplify a lot of states? Even being able to use thorium + custom events in my state mostly does the job. Dunno, just musing at this point.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.