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
Saltstack is historically and by design is not about working with runtime information. One of the features that'd like to see is a requisite which are based on some runtime info.
Here is an example:
I want to run some state but only if the result of the different module is True.
And I want to do it in runtime, not before via Jinja execution of the Salt.
I think it's already possible with slots and onlyif in a way that if slots function will return a string "true" or "false", onlyif will execute it on the system and make a decision based on this.
The executing a shell part is really not necessary and this whole approach is hacky so if we may have a new requisite module just for this that'd be really great.
name: Run command
command: "ls -1 /tmp"
register: result_of_command
name: Do something if you should
when: "'file123' in result_of_command.stdout_lines"
module_name:
<...>
The text was updated successfully, but these errors were encountered:
Description of Issue/Question
Saltstack is historically and by design is not about working with runtime information. One of the features that'd like to see is a requisite which are based on some runtime info.
Here is an example:
I want to run some state but only if the result of the different module is True.
It may look like this:
And I want to do it in runtime, not before via Jinja execution of the Salt.
I think it's already possible with slots and onlyif in a way that if slots function will return a string "true" or "false", onlyif will execute it on the system and make a decision based on this.
The executing a shell part is really not necessary and this whole approach is hacky so if we may have a new requisite module just for this that'd be really great.
This idea is inspired by Ansible's condition engine, which allows doing this:
The text was updated successfully, but these errors were encountered: