Execute Script on Node

231 views
Skip to first unread message

eric....@gmail.com

unread,
Nov 29, 2022, 3:52:13 PM11/29/22
to rundeck-discuss
Hi!  My next issue in migrating to RHEL8 from RHEL7 is trying to run scripts on a different node.  I added the following to  /var/lib/rundeck/projects/myProject/etc/resources.xml 

  <node name="JumpSrvr" description="Jump Server" hostname="myServer.mydomain" osFamily="unix" username="myUser">
    <attribute name="script-exec-shell" value="bash -c"/>
    <attribute name="script-exec" value="${exec.command}"/>
    <attribute name="local-node-executor" value="script-exec"/>
  </node>

Then I put the id_rsa.pub contents into that server in the "myUser" authorized_keys file.  I verified I could ssh there without password from the rundeck machine to that user:

ssh myU...@myServer.myDomain

When I try to set up a simple script to test it, just doing a pwd, it fails with:

Failed: AuthenticationFailure: Authentication failure connecting to node: "JumpSrvr". Make sure your resource definitions and credentials are up to date.
Execution failed: 13 in project myProject: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [JumpSrvr: AuthenticationFailure: Authentication failure connecting to node: "JumpSrvr". Make sure your resource definitions and credentials are up to date. + {dataContext=MultiDataContextImpl(map={ContextView(node:JumpSrvr)=BaseDataContext{{exec={exitCode=-1}}}, ContextView(step:1, node:JumpSrvr)=BaseDataContext{{exec={exitCode=-1}}}}, base=null)} ]}, Node failures: {JumpSrvr=[AuthenticationFailure: Authentication failure connecting to node: "JumpSrvr". Make sure your resource definitions and credentials are up to date. + {dataContext=MultiDataContextImpl(map={ContextView(node:JumpSrvr)=BaseDataContext{{exec={exitCode=-1}}}, ContextView(step:1, node:JumpSrvr)=BaseDataContext{{exec={exitCode=-1}}}}, base=null)} ]}, status: failed]

Any pointers on how to troubleshoot this?

Thanks,
Eric

rac...@rundeck.com

unread,
Nov 29, 2022, 4:01:16 PM11/29/22
to rundeck-discuss
Hi Eric,

That's node definition is wrong, take a look at this example.

If you're planning to create a jump server, consider to use this plugin. More info here.

Regards!

eric....@gmail.com

unread,
Nov 29, 2022, 4:05:34 PM11/29/22
to rundeck-discuss
Hmmm, works great on my RHEL7 machine.  I'll take a look at it.

rac...@rundeck.com

unread,
Nov 29, 2022, 4:12:25 PM11/29/22
to rundeck-discuss
It's a "custom" config to use the node as a jump server :-), try the same configuration with another node executor like SSHJ.

Regards.

eric....@gmail.com

unread,
Nov 30, 2022, 9:32:47 AM11/30/22
to rundeck-discuss
Sorry, you just totally lost me.  I'm not even sure what SSHJ is or where I would put it to do what you're suggesting.  Shouldn't this just work the same in this environment as it would in the previous?  It's just running scripts on the other server as my user and gathering the results...

rac...@rundeck.com

unread,
Nov 30, 2022, 10:25:58 AM11/30/22
to rundeck-discuss
Hi Eric,

That is to discard this issue (related issue here and here).

You can test going to your project > Project Settings (left menu) > Edit Configuration > Default Executor tab and select "SSHJ" instead of "SSH". "SSH" is the default node executor based on JSCH library.

Anyway, make sure to use the rundeck user public key on the authorized_keys remote node account. That is well explained here.

Regards!

eric....@gmail.com

unread,
Nov 30, 2022, 12:18:09 PM11/30/22
to rundeck-discuss
Thanks!  That did the trick!

rac...@rundeck.com

unread,
Nov 30, 2022, 12:34:13 PM11/30/22
to rundeck-discuss
Awesome Eric, happy to help :)
Reply all
Reply to author
Forward
0 new messages