Executing remote inline scripts.

1,486 views
Skip to first unread message

Craig Dunn

unread,
Jan 4, 2011, 11:55:36 AM1/4/11
to rundeck-discuss

Hi all,

I've just started developing a PoC using Rundeck, I'm trying to
demonstrate the inline script ability and having trouble running it on
my remote nodes.

Normal command jobs run fine over all my servers, however when I
specify a simple inline script..

#!/bin/bash

echo foobar

... it runs fine on itself ([console]) and returns success, but it
fails on the remote nodes, when I re-run the failed nodes in debug I
get

04:49:30 ExecutionItem created, executing: dscript:
com.dtolabs.rundeck.execution.BaseWorkflowStrategy$3@47204204
04:49:30 added build listener
04:49:30 number of nodes to dispatch to: 1, (threadcount=1)
04:49:30 Adding reference:
com.dtolabs.rundeck.core.cli.DefaultNodeDispatcher:node.name
04:49:30 Adding reference:
com.dtolabs.rundeck.core.cli.DefaultNodeDispatcher:node.user
04:49:30 executeNodeDispatch: number of nodes to dispatch to: 1,
(threadcount=1)
04:49:30 preparing for sequential execution...
04:49:30 Executing command on node: node1,
NodeEntryImpl{nodename=node1,hostname=node1,type=Node,osName=null,osArch=null,osFamily=null,osVersion=null,username=root,tags=[],attributes=null}
04:49:30 preparing for remote execution ...
04:49:30 0: command( script: #!/bin/bash echo foobar)
04:49:30 ExecutionItem created, executing: dscript:
com.dtolabs.rundeck.execution.BaseWorkflowStrategy$3@4f1932fe
04:49:30 added build listener
04:49:30 number of nodes to dispatch to: 1, (threadcount=1)
04:49:30 Adding reference:
com.dtolabs.rundeck.core.cli.DefaultNodeDispatcher:node.name
04:49:30 Adding reference:
com.dtolabs.rundeck.core.cli.DefaultNodeDispatcher:node.user
04:49:30 executeNodeDispatch: number of nodes to dispatch to: 1,
(threadcount=1)
04:49:30 preparing for sequential execution...
04:49:30 Executing command on node: node2,
NodeEntryImpl{nodename=node2,hostname=node2,type=Node,osName=null,osArch=null,osFamily=null,osVersion=null,username=root,tags=[],attributes=null}
04:49:30 preparing for remote execution ...
[console]
SEVERE 04:49:30 Execution failed on the following 12 nodes: [node1,
node2, <full list snipped by poster> ] at
com.dtolabs.rundeck.core.cli.DefaultNodeDispatcher.executeNodedispatch(DefaultNodeDispatcher.java:
172) at
com.dtolabs.rundeck.execution.NodeFirstWorkflowStrategy.executeWorkflow(NodeFirstWorkflowStrategy.java:
90) at
com.dtolabs.rundeck.execution.WorkflowAction.executeWorkflow(WorkflowAction.java:
53) at
com.dtolabs.rundeck.execution.WorkflowExecutor.executeWorkflow(WorkflowExecutor.java:
72) at
com.dtolabs.rundeck.execution.WorkflowExecutor.executeItem(WorkflowExecutor.java:
56) at
com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeItem(ExecutionServiceImpl.java:
49) at
com.dtolabs.rundeck.core.execution.ExecutionServiceThread.run(ExecutionServiceThread.java:
56)

Can anyone point me in the right direction here?

Many Thanks in advance,

Craig

Aron Bartling

unread,
Jan 4, 2011, 12:19:37 PM1/4/11
to rundeck...@googlegroups.com

Does executing a simple remote command work?

Craig Dunn

unread,
Jan 4, 2011, 12:28:06 PM1/4/11
to rundeck...@googlegroups.com

Yep, commands (both ad-hoc and saved) run just fine, I only encounter this when I try and use a script or in-line script.

Cheers
Craig

Craig Dunn

unread,
Jan 4, 2011, 12:50:22 PM1/4/11
to rundeck...@googlegroups.com

Also, if it helps at all, this is my job definition

- <joblist>
- <job>
  <id>6</id>
  <name>craig test</name>
  <description>test</description>
  <loglevel>INFO</loglevel>
  <group>Craig</group>
- <context>
  <project>test</project>
  </context>
- <sequence threadcount="1" keepgoing="false" strategy="node-first">
- <command>
- <script>
- <![CDATA[
#!/bin/bash

echo foobar
  ]]>
  </script>
  </command>
  </sequence>
- <nodefilters excludeprecedence="true">
- <include>
  <name>.*</name>
  </include>
  </nodefilters>
- <dispatch>
  <threadcount>1</threadcount>
  <keepgoing>true</keepgoing>
  </dispatch>
  </job>
  </joblist>

Cheers
Craig


Greg Schueler

unread,
Jan 4, 2011, 12:55:30 PM1/4/11
to rundeck...@googlegroups.com
Hi Craig,

I notice that your Node definition has osFamily=null.  this needs to be set to either "unix" "cygwin" or "windows" when dispatching a script.  This is because the dispatcher attempts to scp the script to a temp dir on the remote node, and the path is determined by what type of node it is.

try setting it to "unix" or whatever is appropriate.  

It seems like it should have a reasonable default (such as "unix") in the case that it is unset, so this sounds like a potential bug report to file.

can you try that and let us know if it works?

Craig Dunn

unread,
Jan 4, 2011, 1:01:11 PM1/4/11
to rundeck...@googlegroups.com

Hi Greg,

Many thanks, that appears to have done the trick!

Cheers
Craig

Reply all
Reply to author
Forward
0 new messages