can I use sftp instead of scp as fileCopier

405 views
Skip to first unread message

Bertram Karch

unread,
Jul 16, 2015, 1:46:30 AM7/16/15
to rundeck...@googlegroups.com
Hi,

we have problems with scp to HP tandem server. ssh is working, but scp not.
sftp is working, so my question is, can I configure rundeck, so that it uses the command sftp instead of scp for file exchange with this node?
Can I configure the absolut path of the scp command in node configuration?

Bertram

Alex Honor

unread,
Jul 16, 2015, 10:01:13 AM7/16/15
to rundeck...@googlegroups.com
Hi Bertram,

Two ways to go: 1) configure the script-exec plugin or 2) create your own simple plugin.

Alternatively, you can create a FileCopier plugin to use SFTP instead. The plugin can be written in shell and just wrap the sftp invocation.
If it is just for the Tandem nodes you can specify the file-copier as a node attribute just to them.

The plugin.yaml describes a trivial wrapper around the openssh scp command: . The script is here and you'll notice the plugin takes advantage of the key storage facility to access the key when needed.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/f52c99e9-d688-416a-b30f-b24b5ea30e8d%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!

Bertram Karch

unread,
Jul 16, 2015, 4:20:52 PM7/16/15
to rundeck...@googlegroups.com
Hi Alex,

thanks for your fast answer.
I have found the script-exec in project configuration and have written my own FileCopier script.
I wrote a wrapper and use sftp and It works :-).
But it leads to the next problem with inline script steps.
rundeck generates a temporary filename with more than 8 characters, but tandems cuts the filename and the remote exec didn't find the shell-script to execute.
I have taken a deeper look in the example you have mentioned (script execution plugin) and have seen, that the example prints the destination filename
to stdout. Does rundeck takes this name as the final name of remote shell script so I can change this within the wrapper script?
I will make some tests tomorrow.

Thanks for your help

Bertram Karch

unread,
Jul 17, 2015, 3:33:29 AM7/17/15
to rundeck...@googlegroups.com
Hi Alex,

update after some tests:
1. copy workflow step works fine with my own script and sftp
2. inline workflow step didn't work, because rundeck generates a scriptname that is not allowed on tandem.
    I return a valid name from my copy-script, but rundeck doesn't use this return string,
       I got the error:
   chmod: lstat() dispatch20244234343423434.tmp: no such file or directory

Do you know how I can change the name for the remote script?

thanks

Bertram Karch

unread,
Jul 21, 2015, 5:43:25 AM7/21/15
to rundeck...@googlegroups.com
hi Alex,

many thanks for your answer.
I have tested script-exec plugin and wrote a wrapper script, that calls sftp, it works fine!
file copy workflow step now works, but inline script workflow step has a problem.
rundeck generates a long file name for temporary script transferred to remote server, but tandem only accept file names with less than 9 characters
and cuts all characters after character 8.
I tried to generate my own file name in my wrapper script and echoed this at the end of the script, but this was not used from rundeck for the execution on the remote server.

Do you have any idea how I can set my own file name so rundeck uses that?

Thanks


--
You received this message because you are subscribed to a topic in the Google Groups "rundeck-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rundeck-discuss/JQO9o3auGPA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/CA%2BO9DbELMm5WGdXFzg3Qj1cWp-%2BzNiB%3D0ovZAUABeLGagAUUuA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages