I wrote a Chef recipe shutdown the server. Server gets shutdown, but the exit code is 1. I'm trying to use this recipe in Rundeck. Since the exit code is non zero, it is treated as failure in Rundeck orchestration.
I tried adding returns parameter, still same issue. Any suggestions please.
execute 'shutdown_server' do
command 'shutdown -h now'
returns [0,1,-1]
action :run
end
Rundeck Jobs fail with any code other than zero. You should "wrap" your deployment in a Rundeck inline-script job that returns 0 for your specific condition. Check this answer.