Hi
What I really want to do is run a local command/script against a node.hostname and correctly error out if it fails.
I'm having issues with shell execution and escaping with multiple commands (&& or ||). I've tried many workarounds like /bin/bash -c "echo one && echo two" but nothing worked for me.
Adhoc run of echo one && echo two
Local command execution of echo one && echo two
Command execution echo one && echo two
(nothing, just error)
| 12:26:19 | [workflow] Finish execution: rundeck-workflow-node-first: [Workflow , Node failures: {somenode=[]}] |
 | 12:26:19 | [Workflow , Node failures: {somenode=[]}] |
This is what I would like:
res=$(/usr/bin/curl -k -w %{http_code} -s --output /dev/null http://${node.hostname}/) && echo $res && if [ $res -eq 200 ]; then exit 0; else exit 1; fi
A better way to do this would have been a local job with a script that used an option "host" and then call it as a workflow from a remote job passing it's hostname, however... You cannot call a workflow with the parameters "-host ${node.hostname}", it simply does not resolve. A worthwhile feature request?
Cheers
k