How to add Windows Node in Rundeck?

Rundeck allows users to execute jobs to remote Windows nodes to manage and automate tasks using Rundeck workflows. This article shows how to add a Windows node and execute Rundeck jobs and commands with windows-based systems.

To communicate with Windows nodes, Rundeck uses an out-of-the-box Node Execution/ File Copier plugin that uses the WinRM (Windows Remote Management) protocol.

Basic pywinrm Plugin Requirements

The pywinrm plugin (opens new window)needs the following requirements on the Rundeck server to work properly. It is supported on Rundeck running on Linux, Mac OS X, or Windows operating systems.

Requirements

The pywinrm plugin (opens new window)uses the python WinRM Library (opens new window)to provide the WinRM implementation.

  • Python 3.3-3.5 or PyPy2 installed on Rundeck server. (Python 3 strongly recommended)
  • Pywinrm library (It can be installed with the following command:

$ pip install pywinrm
requests-kerberos and requests-credssp are optional.

Basic Windows Requirements

To follow this How to Guide, your Windows system needs the following requirements:

A Windows node in the same network as the Rundeck instance

  • Windows Server 2008 R2 or above
  • PowerShell 2.0 or above

Windows Configuration

The first step is to configure the Windows machine. To do this, go to the Windows instance and follow the these steps:


Open a PowerShell terminal as an admin user profile.
Enable the WinRM protocol on Windows:
$ winrm qc

# Define the authentication type:
$ winrm set winrm/config/service/Auth '@{Basic="true"}'

# Define the client authentication type:
$ winrm set winrm/config/client/Auth '@{Basic="true"}'

# Allow unencrypted SOAP messages:
$ winrm set winrm/config/service '@{AllowUnencrypted="true"}'

Add Windows Key

Don’t forget to add the Windows user password to the Rundeck key storage.

  1. Go to the System Menu(Gear Icon) > Key Storage.

    Key Storage
  2. Click on the + Add or Upload a Key button.
  3. Enter the Windows password as shown in the image and save.

    Key Storage Entry

Rundeck Configuration

Create a Windows-based project on the Rundeck instance.

  1. Create a new project: Name windows, and LabelWindows Jobs

    Create Project
  2. Go to the Default Node Executor tab and then select WinRM Node Executor Python. It may be necessary to set the Python interpreter textbox to python3 interpreter as the command/path.

    Node Executor
  3. Go to the Default File Copier tab and select the WinRM Python File Copier. Similar to the previous step, it may be necessary to define the Python interpreter textbox as python3 interpreter for the command/path.

    File Copier
  4. Click on the Create button.

Adding a Windows Test Node

  1. Click on the Add a new Node Source + button.
  2. Select File
  3. In the Format section, click on the right list and select the resourceyaml option.
  4. Put the file’s desired path including the file name and extension. (e.g. ~/windows-nodes.yaml)
  5. Select check boxes for GenerateInclude Server Node and Writeable checkboxes, and then click on the Save buttons (there are two).
File Source Details

6. Now click on the Edit tab, and click on the Modify button.File Source Code
7. Add the following node definition in the node definition text area. Make sure you use your own nodes IP Address for hostname and login name for username

mywindows:
  description: Windows Server.
  tags: windows
  hostname: 192.168.1.10
  osArch: amd64
  osFamily: windows
  username: Administrator
  winrm-password-storage-path: "keys/windows.password"
Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Charan Siddartha
Charan Siddartha
1 year ago

Thanks’ rajesh, with the above steps i added windows node in rundeck, but while executing a job it got failed,
i want know whether Windows is successfully added or not and also windows is reachable/able to login from rundeck.
can you please guide on this

1
0
Would love your thoughts, please comment.x
()
x