Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding proxy to node executor #100

Merged
merged 10 commits into from
Jan 11, 2024
7 changes: 7 additions & 0 deletions contents/winrm-exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def filter(self, record):
else:
cleanescapingflg = False

ltamaster marked this conversation as resolved.
Show resolved Hide resolved
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)

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -268,6 +272,9 @@ def filter(self, record):
if(readtimeout):
arguments["read_timeout_sec"] = readtimeout

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

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

Expand Down
5 changes: 5 additions & 0 deletions contents/winrm-filecopier.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ def winrm_upload(self,
if "RD_CONFIG_CERTPATH" in os.environ:
certpath = os.getenv("RD_CONFIG_CERTPATH")

ltamaster marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -327,6 +330,8 @@ def winrm_upload(self,

arguments["credssp_disable_tlsv1_2"] = diabletls12

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

if not URLLIB_INSTALLED:
log.error("request and urllib3 not installed, try: pip install requests && pip install urllib3")
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 @@ -314,6 +323,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: WinRMCheck
title: WinRM Check Step
description: Check the connection with a remote node using winrm-python
Expand Down