--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/CAGxOggFq6aOPmASgVm%2Bm7pr1azJVgy2YciOf6txQt255UtW_FA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
So I think you should modify your .bat script to handle the check and exit accordingly instead of delegate the task for salt state itself., thus, the salt states execution will fail all other states that follow it (terminate).I don't know about Windows, but as you said:cmd.script normally will fail when the script returns non-zero status code
> Sometimes the script fails while stopping the service but the result is still green (maybe because the script execution doesn't fail).
So your script failed or not? (on *NIX, it returns non zero status code, then it failed).
On Tue, Jul 18, 2017 at 4:25 PM, varun bhatnagar <varun...@gmail.com> wrote:
Hi,I am having a small testing environment with saltstack - Carbon ( 1 master and 2 windows minions). I have a state file in which I am executing a '.bat' scriptExecute C:\Users\test\Desktop\my_dir\tmp\extracted\my_service\bin\service_install.bat to start service:cmd.script:- name: 'C:\Users\test\Desktop\my_dir\tmp\extracted\my_service\bin\service_start.bat'- cwd: '{{ loc }}\bin\'- args: '--no-pause'Sometimes the script fails while stopping the service but the result is still green (maybe because the script execution doesn't fail).I want to add a check here that if in case it fails then the execution should terminate. Can anyone please help me with this?BR,Varun
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/CAGxOggFq6aOPmASgVm%2Bm7pr1azJVgy2YciOf6txQt255UtW_FA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/85d22abc-3493-4bc7-9e47-37c2c3f4c05b%40googlegroups.com.