packer-community / packer-windows-plugins

A suite of Packer plugins for provisioning Windows machines
113 stars 20 forks source link

WinRM Shell doesn't log output correctly #5

Closed mefellows closed 9 years ago

mefellows commented 9 years ago

When Packer logging is enabled the WinRM Shell should log stdout and stderror to the log file. Currently it only logs errors.

dylanmei commented 9 years ago

I believe commit 2723998a778edd8292922161e3b50718b6904e83 addresses this concern.

Before

==> virtualbox-windows-ovf: Provisioning with windows-shell...
==> virtualbox-windows-ovf: Provisioning with shell script: scripts/quirks.bat
    virtualbox-windows-ovf:
    virtualbox-windows-ovf:
==> virtualbox-windows-ovf: Provisioning with shell script: scripts/rdp.bat
==> virtualbox-windows-ovf: Provisioning with shell script: scripts/no-auto-login.bat
    virtualbox-windows-ovf:
==> virtualbox-windows-ovf: Gracefully halting virtual machine...

After

==> virtualbox-windows-ovf: Provisioning with windows-shell...                                                           [41/4865]
==> virtualbox-windows-ovf: Provisioning with shell script: scripts/quirks.bat
    virtualbox-windows-ovf:
    virtualbox-windows-ovf: C:\Users\packer>C:\Windows\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
    virtualbox-windows-ovf: The operation completed successfully.
    virtualbox-windows-ovf:
    virtualbox-windows-ovf: C:\Users\packer>C:\Windows\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explore
r\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
    virtualbox-windows-ovf: The operation completed successfully.
    virtualbox-windows-ovf:
    virtualbox-windows-ovf: C:\Users\packer>C:\Windows\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explore
r\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
    virtualbox-windows-ovf: The operation completed successfully.
    virtualbox-windows-ovf:
    virtualbox-windows-ovf: C:\Users\packer>C:\Windows\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explore
r\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
    virtualbox-windows-ovf: The operation completed successfully.
==> virtualbox-windows-ovf: Provisioning with shell script: scripts/rdp.bat
    virtualbox-windows-ovf:
    virtualbox-windows-ovf: C:\Users\packer>netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol
=TCP localport=3389
    virtualbox-windows-ovf: Ok.
    virtualbox-windows-ovf:
    virtualbox-windows-ovf:
    virtualbox-windows-ovf: C:\Users\packer>reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDeny
TSConnections /t REG_DWORD /d 0 /f
    virtualbox-windows-ovf: The operation completed successfully.
==> virtualbox-windows-ovf: Provisioning with shell script: scripts/no-auto-login.bat
    virtualbox-windows-ovf:
    virtualbox-windows-ovf:
    virtualbox-windows-ovf: C:\Users\packer>reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v
AutoAdminLogon /d 0 /f
    virtualbox-windows-ovf: The operation completed successfully.
==> virtualbox-windows-ovf: Gracefully halting virtual machine...