How can I copy script from Rundeck server to a brand-new Windows Server

906 Views Asked by At

One of the requirements is to keep remote Windows Server intact. No third party software allowed (no WinSCP, etc).

So we configure Windows Server with WinRM and allow remote access, AllowUnencrypted=true, Auth basic=true, etc... Then we create job and execute command on Windows server like "ifconfig" successfully.

When it comes to executing inline script or copying file - Rundeck is trying to copy script/file to remote Windows server.

By default:

 plugin.script-copy.default.command=get-services

where "get-services" seems to be free-form text rather than executable.

If we want to use SCP or SSH instead, here we have problem -> Windows Server doesn't have WinSCP or SSH or Python installed by default.

Is there any way to copy/deliver script to target/remote Windows Server 2008 using embedded capabilities only (no third-party software allowed) ?

Versions:

Rundeck 2.6.2 running on Linux

Windows Server 2008 R2 Enterprise, Service Pack 1

Thank you.

1

There are 1 best solutions below

0
On

You can use the WinRM plugin (AKA "Overthere WinRM"), configure it, and use the copy file step on your job workflow (keep in mind that you need the 1.3.4 WinRM plugin at least which support copy file).

You need to download the plugin and put it in Rundeck the libext directory.

Add the Windows resources.xml entry (for "Overthere" WinRM plugin):

  <node name="windows" description="Windows node" tags="" hostname="192.168.1.81" osArch="x86" osFamily="windows" osName="Windows 2008R2" osVersion="2008" username="user" winrm-protocol="http" winrm-auth-type="basic" winrm-cmd="CMD" winrm-password-storage-path="keys/winpasswd"/>

Set WinRM as your default node executor / default node file copier, and use the copy file step on your workflow like this.

So, this is important: the WinRM plugin isn't in active development (and Rundeck 2.6 branch is out of support/maintenance), the best way to deal with this is to move to the latest Rundeck version and use the PyWinRM plugin (out of the box with Rundeck, on active development and easiest to configure compared by the old "Overthere" WinRM plugin) and use the copy step as the same way.