Skip to content

Commit

Permalink
Merge pull request #100 from rundeck-plugins/add-winrm-proxy
Browse files Browse the repository at this point in the history
adding proxy to node executor
  • Loading branch information
ltamaster committed Jan 11, 2024
2 parents 40003ae + 7d48328 commit 3a7060c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contents/winrm-exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def httpclient_log(*args):
retryconnection = 1
retryconnectiondelay = 0
username = None
winrmproxy = None

if "RD_CONFIG_AUTHTYPE" in os.environ:
authentication = os.getenv("RD_CONFIG_AUTHTYPE")
Expand Down Expand Up @@ -184,6 +185,10 @@ def httpclient_log(*args):
else:
cleanescapingflg = False

if "RD_CONFIG_WINRMPROXY" in os.environ:
winrmproxy = os.getenv("RD_CONFIG_WINRMPROXY")
log.debug("winrmproxy: " + str(winrmproxy))

if "RD_CONFIG_ENABLEDHTTPDEBUG" in os.environ:
if os.getenv("RD_CONFIG_ENABLEDHTTPDEBUG") == "true":
enabledHttpDebug = True
Expand Down Expand Up @@ -306,6 +311,9 @@ def httpclient_log(*args):
if(readtimeout):
arguments["read_timeout_sec"] = readtimeout

if(winrmproxy):
arguments["proxy"] = winrmproxy

if(operationtimeout):
arguments["operation_timeout_sec"] = operationtimeout

Expand Down
7 changes: 7 additions & 0 deletions contents/winrm-filecopier.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def winrm_upload(self,
retryconnectiondelay = 0
certpath = None
username = None
winrmproxy = None

if os.environ.get('RD_CONFIG_OVERRIDE') == 'true':
override = True
Expand Down Expand Up @@ -295,6 +296,9 @@ def winrm_upload(self,
if "RD_CONFIG_CERTPATH" in os.environ:
certpath = os.getenv("RD_CONFIG_CERTPATH")

if "RD_CONFIG_WINRMPROXY" in os.environ:
winrmproxy = os.getenv("RD_CONFIG_WINRMPROXY")

if "RD_OPTION_USERNAME" in os.environ and os.getenv("RD_OPTION_USERNAME"):
#take user from job
username = os.getenv("RD_OPTION_USERNAME").strip('\'')
Expand Down Expand Up @@ -363,6 +367,9 @@ def winrm_upload(self,

arguments["credssp_disable_tlsv1_2"] = diabletls12

if(winrmproxy):
arguments["proxy"] = winrmproxy

if(readtimeout):
arguments["read_timeout_sec"] = readtimeout

Expand Down
18 changes: 18 additions & 0 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
Expand Down Expand Up @@ -362,6 +371,15 @@ providers:
required: false
renderingOptions:
groupName: Kerberos
- 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: enabledhttpdebug
title: Enable HTTP logging in debug mode
description: "Print extra http logging in debug mode"
Expand Down

0 comments on commit 3a7060c

Please sign in to comment.