vmware-archive / salt-contrib

Salt Module Contributions
http://saltstack.org
Other
169 stars 171 forks source link

IIS configuration fails #124

Open yzach opened 9 years ago

yzach commented 9 years ago

I am trying to configure IIS on Windows 2012R2 x64 via salt. I downloaded and linked salt-contrib. Now when I run:

salt-call --local iis.apppool_list

I am getting the following error

[Error 2] The system cannot find the file specified

But when I am running

salt-call --local cmd.run "C:\Windows\system32\inetsrv\appcmd.exe list APPPOOL"

It displays the configured apppools.

jfindlay commented 9 years ago

@yzach, is it possible for you to provide more log information? There should be a log statement like Executing command <cmd> ....

yzach commented 9 years ago

@jfindlay Please see below

[INFO ] Executing command '"C:\Windows\System32\inetsrv\appcmd.exe" list APPPOOL' in directory 'C:\Users\yzach' [ERROR ] Command '"C:\Windows\System32\inetsrv\appcmd.exe" list APPPOOL' failed with return code: 1 [ERROR ] stderr: '"C:\Windows\System32\inetsrv\appcmd.exe"' is not recognized as an internal or external command, operable program or batch file. [ERROR ] retcode: 1 local: False

yzach commented 9 years ago

I did some investigation, it appears that python tries to execute the file C:\"C:\Windows\System32\inetsrv\appcmd.exe" which apparently does not exists.

Further investigation showed that it is caused by a conflict of quoting in modules/iis.py and a later split in modules/cmdmod.py.

I managed to fix it by patching modules/iis.py#49 with the following line:

cmd_ret = __salt__['cmd.run_all']([appcmd, 'list', resource])

Should I submit a pull request?

jfindlay commented 9 years ago

@yzach, yes, that would be great, thanks.