Closed rhertzog closed 6 years ago
@rhertzog could you specify the salt version for this? to be sure it works
something like:
{% if grains['saltversioninfo'] >= [2017, 7, 3,0] %}
{% endif %}
@aboe76 I don't think that such a test makes sense. If the command was not working in some old version, then it might have been fixed with a point release of that old version. And we would need correct information of what version broke because otherwise adding a supplementary test is just causing more troubles than anything else.
Besides I don't see how you would want to hook that test, it would mean to duplicate the content:
if good-version
if has_exec
state
endif
else
state
endif
... which I find really ugly.
@rhertzog I think you are correct,
The state will not fail gracefully, instead you will get an error like this one:
And since pillar data can't be (easily) tuned according to minion's status, we really need this check here.
My tests with Salt 2017.7.3 have shown that cmd.has_exec() is reliable for this, contrary the what the comment was implying.