Add XML in Rundeck

  • In Project Settings, select ‘Edit Nodes’.
  • You can add a web file in XML format.
  • Enable or disable the cache results as needed.

Create an XML File with PowerShell Script

If you manage inventory types such as SCCM, IVANTI, etc.,

you can extract a list of computers using a PowerShell script. Subsequently, creating an XML file is straightforward.

<pre class="wp-block-syntaxhighlighter-code">$Xmlfile = "c:\Website\RunDeck_nodes.xml"
if(test-path $Xmlfile) { remove-item $Xmlfile -force -recurse }

write-output "<project>" | out-file -append -encoding utf8 $Xmlfile    
foreach ($element in $table) {
    $Computer = $element.DISPLAYNAME
    $tagxml = "Demo"
    Write-output "<node name='$Computer' hostname='$Computer.labo.lan' tags='$tagxml' osFamily='windows' role='LAB' username='$usernamexml' winrm-password-storage-path='$passwordxml' winrm-domain='labo.lan'/>" | out-file -append -encoding utf8 $Xmlfile    
}

write-output "</project>" | out-file -append -encoding utf8 $Xmlfile</pre>

Sharing an XML File

  • If your server is configured with IIS, create a virtual directory in the default website.
  • Paste the XML file into this directory (c:\directoryChooseInVirtualDirectory).
  • Optionally, you can enable Directory Browsing.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.