Giter Site home page Giter Site logo

rundeck-powershell-plugin's Introduction

rundeck-powershell-plugin

Description

A Rundeck Node Executor plugin that allow to execute commands on local or remote nodes via native Powershell.

Tested on Centos 7.3 with Rundeck 2.8.4 and Powershell 6.0b4

The idea is to replace the WinRM ruby plugin with the native Linux Powershell implementation.

A note about the remote node authentication: the plugin supports both Basic and Negotiate(NTLM) types of authentication (tested on Windows Server 2012R2/2016). For security reasons, please use the "Negotiate" authentication type (encrypted) instead of basic (unencrypted)

Setup Powershell for Linux NTLM Authentication

In order to configure NTLM on Linux, on top of the powershell binaries you will need to install the following packages:

  • epel-release
  • krb5-workstation
  • krb5-devel
  • gssntlmssp (requires epel-release to be installed beforehand)

Installation

  • Copy the zip file in $RDECK_BASE/libext
  • Edit your project and select "Powershell Executor" as the default node executor and "Powershell script runner" as the Default Node Copier
  • In the Default Node Executor section add the username and password (only used when invoking commands against a remote host) and select the Authentication Type.
  • Edit your rundeck resources.xml and for each remote node add:
    • node-executor="PSExe" file-copier="PSScript"
  • if you want to run Powershell against your Rundeck Server you also need to add
    • local-node-executor="PSExe" file-copier="PSScript"

Configuration on Windows (only needed for Basic Auth)

winrm set winrm/config/client/auth @{Basic="true"}
winrm set winrm/config/service/auth @{Basic="true"}
winrm set winrm/config/service @{AllowUnencrypted="true"}

Details

This plugin can handle both remote commands and inline scripts.

If the script/command is run agains the local Rundeck host it will just run the command or the script in the local powershell environment

if the script/command is run against a remote node it will run an invoke-command.

The script copier doesn't actually copy anything, it just handles the creation and deletion of the temp script files which get then either executed locally or added to invoke-command with the -filepath parameter

Credits

Much of this work has been inspired by the Rundeck Telnet Plugin and the Rundeck WinRM Plugin

rundeck-powershell-plugin's People

Contributors

giordyb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rundeck-powershell-plugin's Issues

Issue : Script won't run

Hello @giordyb

After running a command successfully I have tried to run this script on the same host:

image

I have this output:

image

Could you help me ?

Thank you

Question : How to override user and password ?

Hello @giordyb

Could you tell me how to override user and password in job definition ? because I have tested with option winrmuser and winrmpass like in Rundeck powershell ruby plugin but it doesn't work.

image

Error:
image

Thank you for your support !

Issue : FailFast: Object reference not set to an instance of an object.

Hi giordyb,

I have an issue when I execute a simple command-line like write-host "Hello" or a simple script :
image

My Rundeck version is 2.10.0
OS : CentOS 7

I have followed the installation instruction without error.

My Rundeck XML ressource file contain for each node like frap050 :
image

I'm using negotiate in Auth type

Could you help me ?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.