{"id":29766,"date":"2022-04-24T13:12:42","date_gmt":"2022-04-24T13:12:42","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=29766"},"modified":"2022-12-23T06:19:26","modified_gmt":"2022-12-23T06:19:26","slug":"how-to-add-windows-node-in-rundeck","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-add-windows-node-in-rundeck\/","title":{"rendered":"How to add Windows Node in Rundeck?"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basic pywinrm Plugin Requirements<\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Requirements<\/h2>\n\n\n\n<p>The pywinrm plugin (opens new window)uses the python WinRM Library (opens new window)to provide the WinRM implementation.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Python 3.3-3.5 or PyPy2 installed on Rundeck server. (Python 3 strongly recommended)<\/li><li>Pywinrm library (It can be installed with the following command:<\/li><\/ul>\n\n\n\n<p>$ pip install pywinrm<br>requests-kerberos and requests-credssp are optional.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basic Windows Requirements<\/h2>\n\n\n\n<p>To follow this How to Guide, your Windows system needs the following requirements:<\/p>\n\n\n\n<p>A Windows node in the same network as the Rundeck instance<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Windows Server 2008 R2 or above<\/li><li>PowerShell 2.0 or above<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Windows Configuration<\/h2>\n\n\n\n<p>The first step is to configure the Windows machine. To do this, go to the Windows instance and follow the these steps:<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">Open a PowerShell terminal <span class=\"hljs-keyword\">as<\/span> an admin user profile.\r\nEnable the WinRM protocol on Windows:\r\n$ winrm qc\r\n\r\n<span class=\"hljs-comment\"># Define the authentication type:<\/span>\r\n$ winrm set winrm\/config\/service\/Auth <span class=\"hljs-string\">'@{Basic=\"true\"}'<\/span>\r\n\r\n<span class=\"hljs-comment\"># Define the client authentication type:<\/span>\r\n$ winrm set winrm\/config\/client\/Auth <span class=\"hljs-string\">'@{Basic=\"true\"}'<\/span>\n\r\n<span class=\"hljs-comment\"># Allow unencrypted SOAP messages:<\/span>\r\n$ winrm set winrm\/config\/service <span class=\"hljs-string\">'@{AllowUnencrypted=\"true\"}'<\/span>\r\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Add Windows Key<\/h2>\n\n\n\n<p>Don&#8217;t forget to add the Windows user password to the Rundeck key storage.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to the&nbsp;<em>System Menu(Gear Icon) &gt; Key Storage<\/em>.<br><br><img decoding=\"async\" src=\"https:\/\/docs.rundeck.com\/docs\/assets\/img\/howto-winnode-keystorage.e0bc4365.png\" alt=\"Key Storage\"><br><\/li><li>Click on the&nbsp;<strong>+ Add or Upload a Key<\/strong>&nbsp;button.<\/li><li>Enter the Windows password as shown in the image and save.<br><br><img decoding=\"async\" src=\"https:\/\/docs.rundeck.com\/docs\/assets\/img\/howto-winnode-keystorageentry.9d67f8f8.png\" alt=\"Key Storage Entry\"><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"rundeck-configuration\">Rundeck Configuration<\/h2>\n\n\n\n<p>Create a Windows-based project on the Rundeck instance.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Create a new project:&nbsp;<strong>Name<\/strong>&nbsp;<code>windows<\/code>, and&nbsp;<strong>Label<code>Windows Jobs<\/code><\/strong><br><br><img decoding=\"async\" src=\"https:\/\/docs.rundeck.com\/docs\/assets\/img\/howto-winnode-createproject.653a28b8.png\" alt=\"Create Project\"><br><\/li><li>Go to the Default Node Executor tab and then select&nbsp;<strong>WinRM Node Executor Python<\/strong>. It may be necessary to set the Python interpreter textbox to&nbsp;<code>python3<\/code>&nbsp;interpreter as the command\/path.<br><br><img decoding=\"async\" src=\"https:\/\/docs.rundeck.com\/docs\/assets\/img\/howto-winnode-nodeexec.57771c71.png\" alt=\"Node Executor\"><br><\/li><li>Go to the&nbsp;<strong>Default File Copier<\/strong>&nbsp;tab and select the&nbsp;<strong>WinRM Python File Copier<\/strong>. Similar to the previous step, it may be necessary to define the Python interpreter textbox as&nbsp;<code>python3<\/code>&nbsp;interpreter for the command\/path.<br><br><img decoding=\"async\" src=\"https:\/\/docs.rundeck.com\/docs\/assets\/img\/howto-winnode-filecopy.58d6af3b.png\" alt=\"File Copier\"><br><\/li><li>Click on the&nbsp;<strong>Create<\/strong>&nbsp;button.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Adding a Windows Test Node<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Click on the\u00a0<strong>Add a new Node Source +<\/strong>\u00a0button.<\/li><li>Select\u00a0<strong>File<\/strong><\/li><li>In the\u00a0<em>Format<\/em>\u00a0section, click on the right list and select the\u00a0<strong>resourceyaml<\/strong>\u00a0option.<\/li><li>Put the file&#8217;s desired path including the file name and extension. (e.g.\u00a0<code>~\/windows-nodes.yaml<\/code>)<\/li><li>Select check boxes for\u00a0<strong>Generate<\/strong>,\u00a0<strong>Include Server Node<\/strong>\u00a0and\u00a0<strong>Writeable<\/strong>\u00a0checkboxes, and then click on the\u00a0<strong>Save<\/strong>\u00a0buttons (<em>there are two<\/em>).<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/docs.rundeck.com\/docs\/assets\/img\/howto-winnode-filesourcedetails.542d03b0.png\" alt=\"File Source Details\"\/><\/figure>\n\n\n\n<p>6. Now click on the\u00a0<em>Edit<\/em>\u00a0tab, and click on the\u00a0<strong>Modify<\/strong>\u00a0button.<img decoding=\"async\" src=\"https:\/\/docs.rundeck.com\/docs\/assets\/img\/howto-winnode-modifyfilesource.9161fb71.png\" alt=\"File Source Code\"><br>7. Add the following node definition in the node definition text area. Make sure you use your own nodes IP Address for\u00a0<em>hostname<\/em>\u00a0and login name for\u00a0<em>username<\/em><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">mywindows:\r\n  description: Windows Server.\r\n  tags: windows\r\n  <span class=\"hljs-attr\">hostname<\/span>: <span class=\"hljs-number\">192.168<\/span><span class=\"hljs-number\">.1<\/span><span class=\"hljs-number\">.10<\/span>\r\n  <span class=\"hljs-attr\">osArch<\/span>: amd64\r\n  <span class=\"hljs-attr\">osFamily<\/span>: windows\r\n  <span class=\"hljs-attr\">username<\/span>: Administrator\r\n  winrm-password-storage-path: <span class=\"hljs-string\">\"keys\/windows.password\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>","protected":false},"excerpt":{"rendered":"<p>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&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-29766","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=29766"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29766\/revisions"}],"predecessor-version":[{"id":29772,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29766\/revisions\/29772"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=29766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=29766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=29766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}