From 9b0f72fdbb2b512aa226fcaaafb5fb8c0bf70be2 Mon Sep 17 00:00:00 2001 From: Jake Cohen Date: Wed, 6 Dec 2023 13:25:36 -0800 Subject: [PATCH] adding proxy field to node executor --- contents/winrm-exec.py | 7 +++++++ plugin.yaml | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/contents/winrm-exec.py b/contents/winrm-exec.py index 75df1d9..af77570 100755 --- a/contents/winrm-exec.py +++ b/contents/winrm-exec.py @@ -164,6 +164,9 @@ def filter(self, record): else: cleanescapingflg = False +if "RD_CONFIG_WINRMPROXY" in os.environ: + winrmproxy = os.getenv("RD_CONFIG_WINRMPROXY") + exec_command = os.getenv("RD_EXEC_COMMAND") log.debug("Command will be executed: " + exec_command) @@ -229,6 +232,7 @@ def filter(self, record): log.debug("operationtimeout:" + str(operationtimeout)) log.debug("exit Behaviour:" + exitBehaviour) log.debug("cleanescapingflg: " + str(cleanescapingflg)) +log.debug("winrmproxy: " + str(winrmproxy)) log.debug("------------------------------------------") if not URLLIB_INSTALLED: @@ -268,6 +272,9 @@ def filter(self, record): if(readtimeout): arguments["read_timeout_sec"] = readtimeout +if(winrmproxy): + arguments["winrm_proxy"] = winrmproxy + if(operationtimeout): arguments["operation_timeout_sec"] = operationtimeout diff --git a/plugin.yaml b/plugin.yaml index 8303e27..2bbe196 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -101,6 +101,15 @@ providers: renderingOptions: groupName: Connection instance-scope-node-attribute: "winrm-readtimeout" + - name: winrmproxy + title: Proxy + description: "Specify a proxy address for communicating with Windows nodes. Example HTTP proxy strings are http://server:port and http://user:pass@server:port. An example SOCKS5 proxy string is socks5://user:pass@server:port." + type: String + required: false + scope: Instance + renderingOptions: + groupName: Connection + instance-scope-node-attribute: "winrm-proxy" - name: operationtimeout title: operation timeout description: "maximum allowed time in seconds for any single wsman HTTP operation (default 20). Note that operation timeouts while receiving output (the only wsman operation that should take any significant time, and where these timeouts are expected) will be silently retried indefinitely. It can be overwriting at node level using `winrm-operationtimeout`"