Script Plugin - Windows - Merge Environment

47 views
Skip to first unread message

greg...@gmail.com

unread,
Feb 20, 2022, 12:41:42 PM2/20/22
to rundeck-discuss
I am using Rundeck 3.4.10 (community edition) on Windows. I am testing a script plugin to run Powershell based off these docs: https://docs.rundeck.com/docs/developer/01-plugin-development.html#script-plugin-development

When executing scripts or commands the system environment variables aren't being being created. I think they should be created based on setting the plugin version to 1.2 but I have also tried setting mergeEnvironment to true without any luck. 

After importing my test plugin I am setting local-node-executor to the local node attributes.
local-node-executor=test-script-plugin-powershell

Running a job that is a command or inline script will only show the RD_* environment variables and none of the system ones. I am not sure what I am doing wrong.

TEST-SCRIPT-PLUGIN
|   plugin.yaml
|
\---contents
        script.ps1

plugin.yaml
--------
# yaml plugin metadata

name: test-script-plugin
version: 1.0
rundeckPluginVersion: 1.2
author: author name
date: 2022-02-20
url: website URL
providers:
  - name: test-script-plugin-powershell
    service: NodeExecutor
    plugin-type: script
    script-interpreter: powershell.exe -NoLogo -NonInteractive -NoProfile -File
    script-file: script.ps1
    #script-args: [script file args]
    mergeEnvironment: true


script.ps1
--------
Get-ChildItem Env:

rac...@rundeck.com

unread,
Feb 22, 2022, 11:05:20 AM2/22/22
to rundeck-discuss
Hi Greg,

I tested your plugin and tried different approaches but I saw the same behavior, could you open a new issue here?

Thank you!

greg...@gmail.com

unread,
Feb 22, 2022, 9:01:17 PM2/22/22
to rundeck-discuss
Thanks for confirming. I created an issue: https://github.com/rundeck/rundeck/issues/7551
Reply all
Reply to author
Forward
0 new messages