Commit a09d7a64 authored by dylanmei's avatar dylanmei

Add missing TEMP environment variable; fixes chocolatey.bat wip

parent 7b636e9d
......@@ -231,13 +231,6 @@
<Order>22</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\hotfix-KB2842230.ps1</CommandLine>
<Description>Install Windows Updates</Description>
<Order>23</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
-->
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c a:\openssh-6.2.bat</CommandLine>
......
powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"
cmd /c setx /m PATH "%path%;C:\\Chocolatey\bin"
......@@ -6,9 +6,12 @@ if exist a:\openssh-6.2.exe (
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.mls-software.com/files/setupssh-6.2p2-1-v1(x64).exe', 'C:\Windows\Temp\openssh-6.2.exe')"
)
cmd /c C:\Windows\temp\openssh-6.2.exe /S /port=22 /privsep=1 /password=D@rj33l1ng
cmd /c echo PermitUserEnvironment yes >> "C:\Program Files\OpenSSH\etc\sshd_config"
powershell -Command "Start-Sleep -s 10"
net stop opensshd
@rem ensure vagrant can log in
mkdir "C:\Users\vagrant"
mkdir "C:\Users\vagrant\.ssh"
cmd /c C:\Windows\System32\icacls.exe "C:\Users\vagrant" /grant vagrant:(OI)(CI)F
cmd /c C:\Windows\System32\icacls.exe "C:\Program Files\OpenSSH\bin" /grant vagrant:(OI)RX
cmd /c C:\Windows\System32\icacls.exe "C:\Program Files\OpenSSH\usr\sbin" /grant vagrant:(OI)RX
......@@ -18,16 +21,11 @@ powershell -Command "(Get-Content 'C:\Program Files\OpenSSH\etc\passwd') | Forea
rd /S /Q "C:\Program Files\OpenSSH\tmp"
cmd /c ""C:\Program Files\OpenSSH\bin\junction.exe" /accepteula "C:\Program Files\OpenSSH\tmp" C:\Windows\Temp"
cmd /c C:\Windows\System32\icacls.exe "C:\Windows\Temp" /grant vagrant:(OI)(CI)F
@rem vagrant public key useful later
mkdir "C:\Users\vagrant\.ssh"
if exist a:\vagrant.pub (
copy a:\vagrant.pub C:\Users\vagrant\.ssh\authorized_keys
) else (
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys')"
)
echo TEMP=C:\\Windows\\Temp > C:\Users\vagrant\.ssh\environment
@rem configure firewall
netsh advfirewall firewall add rule name="SSHD" dir=in action=allow service=OpenSSHd enable=yes
netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="C:\Program Files\OpenSSH\usr\sbin\sshd.exe" enable=yes
netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
net start opensshd
@rem vagrant public key
mkdir "C:\Users\vagrant\.ssh"
if exist a:\vagrant.pub (
copy a:\vagrant.pub C:\Users\vagrant\.ssh\authorized_keys
) else (
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys')"
)
......@@ -17,7 +17,6 @@
"floppy_files": [
"./answer_files/2012/Autounattend.xml",
"./scripts/win-updates.ps1",
"./scripts/openssh-6.2.exe",
"./scripts/openssh-6.2.bat"
],
"vmx_data": {
......@@ -36,7 +35,7 @@
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "8h",
"shutdown_command": "shutdown /s /t 2400 /f /d p:4:1 /c \"Vagrant Shutdown\"",
"shutdown_command": "shutdown /s /t 4800 /f /d p:4:1 /c \"Vagrant Shutdown\"",
"shutdown_timeout": "8h",
"guest_os_type": "Windows2012_64",
"disk_size": 61440,
......@@ -44,8 +43,6 @@
"floppy_files": [
"./answer_files/2012/Autounattend.xml",
"./scripts/win-updates.ps1",
"./scripts/hotfix-KB2842230.ps1",
"./scripts/Windows8-RT-KB2842230-x64.msu",
"./scripts/openssh-6.2.bat",
"./scripts/oracle-cert.cer"
],
......@@ -55,16 +52,15 @@
]
}],
"provisioners": [{
"type": "shell",
"remote_path": "/tmp/script.bat",
"execute_command": "cmd /c C:/Windows/Temp/script.bat",
"scripts": [
"./scripts/echo.bat",
"./scripts/virtualbox-tools.bat",
"./scripts/puppet.bat",
"./scripts/chef.bat",
"./scripts/chocolatey.bat"
]
"type": "shell",
"remote_path": "/tmp/script.bat",
"execute_command": "{{ .Vars }} cmd /c C:/Windows/Temp/script.bat",
"scripts": [
"./scripts/virtualbox-tools.bat",
"./scripts/puppet.bat",
"./scripts/chef.bat",
"./scripts/chocolatey.bat"
]
}],
"post-processors": [{
"type": "vagrant",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment