diff --git a/README.md b/README.md index efa2b6c..6f0cc1d 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ For further information see: ## Configuration * **Authentication Type**: The authentication type used for the connection: basic, ntlm, credssp. It can be overwriting at node level using `winrm-authtype` +* **Username**: (Optional) Username that will connect to the remote node. This value can be set also at node level or as a job input option (with the name `username) * **Password Storage Path**: Key storage path of the window's user password. It can be overwriting at node level using `winrm-password-storage-path` * **No SSL Verification**: When set to true SSL certificate validation is not performed. It can be overwriting at node level using `winrm-nossl` * **WinRM Transport Protocol**: WinRM transport protocol (http or https). It can be overwriting at node level using `winrm-transport` @@ -64,7 +65,7 @@ For further information see: winrm-authtype="credssp"/> ``` -The username can be overwritten using a job input option called "username". +The username can be overwritten using a job input option called "username"` or it can be set at project level. ## Limitations diff --git a/contents/winrm-check.py b/contents/winrm-check.py index 75b670f..7246943 100644 --- a/contents/winrm-check.py +++ b/contents/winrm-check.py @@ -38,13 +38,13 @@ port = args.port if args.nossl: - if args.nossl == "True": + if args.nossl == "true": nossl = True else: nossl = False if args.debug: - if args.debug == "True": + if args.debug == "true": debug = True else: debug = False @@ -67,7 +67,6 @@ endpoint=transport+'://'+hostname+':'+port - if(debug): print "------------------------------------------" print "endpoint:" +endpoint @@ -77,16 +76,15 @@ print "transport:" + transport print "------------------------------------------" - - - if(nossl): - session = winrm.Session(endpoint, auth=(username, password), - transport=authentication, - server_cert_validation='ignore') + session = winrm.Session(endpoint, + auth=(username, password), + transport=authentication, + server_cert_validation='ignore') else: - session = winrm.Session(endpoint, auth=(username, password), - transport=authentication) + session = winrm.Session(endpoint, + auth=(username, password), + transport=authentication) exec_command = "ipconfig" result = session.run_cmd(exec_command)