How to configure Rundeck to execute scripts from their current location?

4,809 views
Skip to first unread message

John Landells

unread,
Sep 15, 2016, 6:50:44 PM9/15/16
to rundeck-discuss
I currently have an issue where I need to run some Python scripts directly on the Rundeck server (local) but they need to be executed from their current directory, due to dependencies on other files in the same directory.  However, Rundeck seems to be copying the files to /tmp before executing them.

Is there any way to prevent this behaviour, please?

Many thanks! 

Peter Garlic

unread,
Sep 16, 2016, 3:48:52 AM9/16/16
to rundeck-discuss
Hi John
I had a similiar problem on some "hardenized" systems, where you cannot execute scripts from tmp.
To solve the problem I´ve reconfigured the remote execution plugin inside project properties in that way:

DEFAULT NODE EXECUTOR
Script execution
Command: /usr/bin/ssh -q -tt  ${node.username}@${node.hostname} -- ${exec.command}
DEFAULT NODE COPIER
Script execution
Command: /usr/bin/scp -q ${file-copy.file} ${node.username}@${node.hostname}:${file-copy.destination}
Remote Filepath: ${node.destdir}/${file-copy.filename}

This mean that the script would not copied on /tmp but on home directory of rundeck user.
I think that in the same way you can change the target path.

Also  you can call your python script from a shell script that use a "cd /path/to/your/file" before to launch them

I hope this help.
Let me know
-Peter


Alex Honor

unread,
Sep 16, 2016, 10:57:51 AM9/16/16
to rundeck...@googlegroups.com
Hi John,

How is the job defined for dispatching? Is the job dispatched to Nodes or left to run locally?

Thanks

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/9670fce0-25ed-441f-b551-36d4d7ace1af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Alex Honor

[SimplifyOps, Inc | a...@simplifyops.com ]

Be sure to comment and vote on Rundeck Feature Development!

Message has been deleted

John Landells

unread,
Sep 26, 2016, 4:54:22 AM9/26/16
to rundeck-discuss
Hi Peter,

I ended up going for the shell script route, as it kept everything neat.

Thanks for your input! :)

Kind regards,
-John.

Peter Garlic

unread,
Sep 26, 2016, 10:30:00 AM9/26/16
to rundeck-discuss
:D
-Peter

Sandeep Damacharla

unread,
Dec 6, 2016, 10:13:05 AM12/6/16
to rundeck-discuss
Hi Alex,

Please bare with if my question is really obvious, I am new to rundeck. I have a job that is dispatched to an AWS EC2-Instance.My objective is to run a python script but it has dependencies on some sql files in the same folder.I am unable to figure out how to make these sql's move into EC2-Instance(I am dynamically spinning up a Ec2 and trying to run the script and terminate the instance(part of cost saving))


On Friday, September 16, 2016 at 8:27:51 PM UTC+5:30, Alex Honor wrote:
Hi John,

How is the job defined for dispatching? Is the job dispatched to Nodes or left to run locally?

Thanks
On Thu, Sep 15, 2016 at 3:44 PM, 'John Landells' via rundeck-discuss <rundeck...@googlegroups.com> wrote:
I currently have an issue where I need to run some Python scripts directly on the Rundeck server (local) but they need to be executed from their current directory, due to dependencies on other files in the same directory.  However, Rundeck seems to be copying the files to /tmp before executing them.

Is there any way to prevent this behaviour, please?

Many thanks! 

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.

Alex Honor

unread,
Dec 6, 2016, 10:17:54 AM12/6/16
to rundeck...@googlegroups.com
Hi Sandeep,

Take a look at the Copy File node step. You can copy your SQL files to your EC2 instances with that. 

Thanks

To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/69d65645-0ab6-4851-a8bb-e92a89034a3e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages