rundeck-plugins / rundeck-winrm-plugin

Rundeck WinRM Node Executor plugin
Other
56 stars 28 forks source link

Problem with command RD_EXEC_COMMAND on WinRM nodes #53

Closed keyser75000 closed 6 years ago

keyser75000 commented 6 years ago

Hi,

I use two plugins to manage via WinRM my Windows servers. I noticed that my jobs, on both plugins, that use Script or ScriptFile failed with same error : The term 'chmod' is not recognized as the name of a cmdlet, function, script file, or operable program.

It seems that rundeck Job add "chmod +x" command to RD_EXEC_COMMAND variable (powershell script in my case). I use Rundeck 2.10.6, plugins rd-winrm-plugin and rundeck-winrm-plugin. This behavior didn't happen in earlier versions (2.9.x and maybe 2.10.2-).

I can bypass this error in file winrmexe.rb by modify a test on chmod (to delete it from command) but I did not update these plugins since. I just updated Rundeck several times. Then I realized this issue happen.

RD_EXEC_COMMAND => chmod +x c:\temp\228-5513-SMRFGENE8K133-restart_fusioninventory.ps1.sh and

variables:
realm => REALM
endpoint => http://xxxx:5985/wsman
user => DOMAIN\user
pass => ********
timeout => 60
command => chmod +x c:\temp\228-5513-xxxx-restart_fusioninventory.ps1.sh
newcommand => chmod +x c:\temp\228-5513-xxxx-restart_fusioninventory.ps1.sh

Thanks for help (I post too an issue on rd-winrm-plugin Github).

keyser75000 commented 6 years ago

Solved. I change osFamily to "windows" in node config instead of "MSWin32". cf. (rundeck #3144)