exit /b 2 batch command is not working when i trigger rundeck job

47 views
Skip to first unread message

Vinay Kumar

unread,
Sep 13, 2023, 5:17:52 AM9/13/23
to rundeck-discuss
Hi,

When i run below script through rundeck server manually, "exit /b 2" is working fine and failing job.
Below is the batch script script
if "%output%" equ "1" (
    echo "Completed"
) else (
    echo %output%
    echo "Error, For Some Jobs because Event status was other than 4"
    exit /b 2
)


When i run through rundeck Job is not failing because "exit /b  2" is passing furthur process.

Below is my flow:
==============
I am running Shell Script from Rundeck UI
Shell Script --> ansible script(It will connect to windows server, place and execute file in windows server) --> batch script

My Rundeck Server is linux Server.
When i trigger Shell Script for running Batch Script through linux server, "exit /b 2" is working and getting failed at that stage.

When i trigger same through rundeck, It is not failing and passing through Next Stages.

Can anyone please suggest me on this

Vinay Kumar

unread,
Sep 13, 2023, 5:19:26 AM9/13/23
to rundeck-discuss
Shell Script --> ansible script(It will connect to windows server, place and execute batch script file in windows server) --> batch script

Vinay Kumar

unread,
Sep 13, 2023, 5:21:56 AM9/13/23
to rundeck-discuss
i Have tried all below exit statements

exit
exit /b
exit /b 1
exit /b 2
exit /b 3
exit /b 4
exit /b 5

rac...@rundeck.com

unread,
Sep 13, 2023, 8:55:49 AM9/13/23
to rundeck-discuss
Hi Vinay,

Have you tried running the script through Ansible directly? (without Rundeck, to discard an Ansible plugin issue).

Could you share an example job definition to take a look?

Regards.
Reply all
Reply to author
Forward
0 new messages