[FEATURE REQUEST] alwaysunless and alwaysif requisites
#67273
Replies: 2 comments
-
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
Beta Was this translation helpful? Give feedback.
-
|
It's not clear what you want your example to do. If you want the ISO to always exist and have the latest contents, and not re-create if it hasn't changed: /path/to/isofiles:
file.recurse:
- source: salt://isofiles
mkisofs -rJo /path/to/iso /path/to/isofiles:
cmd.run:
- creates: /path/to/iso
- watch:
- /path/to/isofilesI'm not sure where the requisite returning Wanting to In any case, such semantics are entirely separate from |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Requisites that guarantee that a state will run under certain conditions don't exist, in particular with use of the
onchangesandprereqrequisites.Describe the solution you'd like
The implementation of
alwaysunlessandalwaysifrequisites, mutually exclusive withunlessandonlyif:alwaysunless: specifies that a state will always run when any of the specified commands returnFalse, operating as NAND.alwaysif: specifies that if each command listed inalwaysifreturnsTrue, then the state is always run. If any of the specified commands returnFalse, the state is not guaranteed to run.For further clarification, here's a truth table, the left side describing the scenario and the right side showing if a state with the given requisite will run:
onchanges/prereqisTrueTrueunlessonlyifalwaysunlessalwaysifIf implemented, these requisites could be used like so:
Describe alternatives you've considered
An existing workaround is the use of additional states:
While this could be an argument against the
alwaysunlessandalwaysifrequisites, similar alternatives exist forunlessandonlyifas well, so their existence suggests thatalwaysunlessandalwaysifshould exist too.Beta Was this translation helpful? Give feedback.
All reactions