Skip to content

Commit

Permalink
Merge pull request #1053 from chef/windows_v2
Browse files Browse the repository at this point in the history
Initial windows support
  • Loading branch information
Seth Thomas authored Jun 4, 2018
2 parents 74566ad + f3d5c69 commit c21e1a3
Show file tree
Hide file tree
Showing 27 changed files with 1,671 additions and 0 deletions.
65 changes: 65 additions & 0 deletions windows/2008r2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"builders": [{
"type": "virtualbox-iso",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "2048"],
["modifyvm", "{{.Name}}", "--vram", "48"],
["modifyvm", "{{.Name}}", "--cpus", "2"]
],
"guest_additions_mode": "{{ user `guest_additions_mode` }}",
"guest_additions_path": "C:/users/vagrant/VBoxGuestAdditions.iso",
"guest_os_type": "Windows2008_64",
"headless": "{{ user `headless` }}",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "sha1",
"output_directory": "../builds/packer-{{user `template`}}-virtualbox",
"communicator": "winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "12h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_timeout": "15m",
"floppy_files": [
"answer_files/2008_r2/Autounattend.xml"
]
}],
"provisioners": [{
"type": "chef-solo",
"cookbook_paths": ["cookbooks"],
"guest_os_type": "windows",
"install_command": "powershell.exe -Command \"(new-object Net.WebClient).DownloadString('https://omnitruck.chef.io/install.ps1') | iex; install\"",
"run_list": [
"packer::vm_tools",
"packer::uninstall_powershell_ise",
"packer::enable_file_sharing",
"packer::enable_remote_desktop",
"packer::ui_tweaks",
"packer::power",
"packer::cleanup",
"packer::defrag"
]
},
{
"type": "powershell",
"script": "scripts/cleanup.ps1",
"elevated_user": "vagrant",
"elevated_password": "vagrant"
}
],
"post-processors": [
[{
"type": "vagrant",
"keep_input_artifact": true,
"output": "{{ user `template` }}-{{.Provider}}.box",
"vagrantfile_template": "vagrantfile-windows.template"
}]
],
"variables": {
"guest_additions_mode": "attach",
"headless": "false",
"iso_checksum": "beed231a34e90e1dd9a04b3afabec31d62ce3889",
"iso_url": "http://download.microsoft.com/download/7/5/E/75EC4E54-5B02-42D6-8879-D8D3A25FBEF7/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso",
"template": "windows-2008r2-standard"
}
}
64 changes: 64 additions & 0 deletions windows/2012r2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"builders": [{
"type": "virtualbox-iso",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "2048"],
["modifyvm", "{{.Name}}", "--vram", "48"],
["modifyvm", "{{.Name}}", "--cpus", "2"]
],
"guest_additions_mode": "{{ user `guest_additions_mode` }}",
"guest_additions_path": "C:/users/vagrant/VBoxGuestAdditions.iso",
"guest_os_type": "Windows2012_64",
"headless": "{{ user `headless` }}",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "sha1",
"output_directory": "../builds/packer-{{user `template`}}-virtualbox",
"communicator": "winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "12h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_timeout": "15m",
"floppy_files": [
"answer_files/2012_r2/Autounattend.xml"
]
}],
"provisioners": [{
"type": "chef-solo",
"cookbook_paths": ["cookbooks"],
"guest_os_type": "windows",
"run_list": [
"packer::vm_tools",
"packer::uninstall_powershell_ise",
"packer::enable_file_sharing",
"packer::enable_remote_desktop",
"packer::ui_tweaks",
"packer::power",
"packer::cleanup",
"packer::defrag"
]
},
{
"type": "powershell",
"script": "scripts/cleanup.ps1",
"elevated_user": "vagrant",
"elevated_password": "vagrant"
}
],
"post-processors": [
[{
"type": "vagrant",
"keep_input_artifact": true,
"output": "{{ user `template` }}-{{.Provider}}.box",
"vagrantfile_template": "vagrantfile-windows.template"
}]
],
"variables": {
"guest_additions_mode": "attach",
"headless": "false",
"iso_checksum": "849734f37346385dac2c101e4aacba4626bb141c",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO",
"template": "windows-2012r2-standard"
}
}
64 changes: 64 additions & 0 deletions windows/2016.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"builders": [{
"type": "virtualbox-iso",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "2048"],
["modifyvm", "{{.Name}}", "--vram", "48"],
["modifyvm", "{{.Name}}", "--cpus", "2"]
],
"guest_additions_mode": "{{ user `guest_additions_mode` }}",
"guest_additions_path": "C:/users/vagrant/VBoxGuestAdditions.iso",
"guest_os_type": "Windows2016_64",
"headless": "{{ user `headless` }}",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "sha1",
"output_directory": "../builds/packer-{{user `template`}}-virtualbox",
"communicator": "winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "12h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_timeout": "15m",
"floppy_files": [
"answer_files/2012_r2/Autounattend.xml"
]
}],
"provisioners": [{
"type": "chef-solo",
"cookbook_paths": ["cookbooks"],
"guest_os_type": "windows",
"run_list": [
"packer::vm_tools",
"packer::uninstall_powershell_ise",
"packer::enable_file_sharing",
"packer::enable_remote_desktop",
"packer::ui_tweaks",
"packer::power",
"packer::cleanup",
"packer::defrag"
]
},
{
"type": "powershell",
"script": "scripts/cleanup.ps1",
"elevated_user": "vagrant",
"elevated_password": "vagrant"
}
],
"post-processors": [
[{
"type": "vagrant",
"keep_input_artifact": true,
"output": "{{ user `template` }}-{{.Provider}}.box",
"vagrantfile_template": "vagrantfile-windows.template"
}]
],
"variables": {
"guest_additions_mode": "attach",
"headless": "true",
"iso_checksum": "772700802951b36c8cb26a61c040b9a8dc3816a3",
"iso_url": "https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO",
"template": "windows-2016-standard"
}
}
65 changes: 65 additions & 0 deletions windows/7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"builders": [{
"type": "virtualbox-iso",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "5120"],
["modifyvm", "{{.Name}}", "--vram", "36"],
["modifyvm", "{{.Name}}", "--cpus", "2"]
],
"guest_additions_mode": "{{ user `guest_additions_mode` }}",
"guest_additions_path": "C:/users/vagrant/VBoxGuestAdditions.iso",
"guest_os_type": "Windows7_64",
"headless": "{{ user `headless` }}",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "sha1",
"output_directory": "../builds/packer-{{user `template`}}-virtualbox",
"communicator": "winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "12h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_timeout": "15m",
"floppy_files": [
"answer_files/7/Autounattend.xml"
]
}],
"provisioners": [{
"type": "chef-solo",
"cookbook_paths": ["cookbooks"],
"guest_os_type": "windows",
"install_command": "powershell.exe -Command \"(new-object Net.WebClient).DownloadString('https://omnitruck.chef.io/install.ps1') | iex; install\"",
"run_list": [
"packer::vm_tools",
"packer::uninstall_powershell_ise",
"packer::enable_file_sharing",
"packer::enable_remote_desktop",
"packer::ui_tweaks",
"packer::power",
"packer::cleanup",
"packer::defrag"
]
},
{
"type": "powershell",
"script": "scripts/cleanup.ps1",
"elevated_user": "vagrant",
"elevated_password": "vagrant"
}
],
"post-processors": [
[{
"type": "vagrant",
"keep_input_artifact": true,
"output": "{{ user `template` }}-{{.Provider}}.box",
"vagrantfile_template": "vagrantfile-windows.template"
}]
],
"variables": {
"guest_additions_mode": "attach",
"headless": "false",
"iso_checksum": "36ae90defbad9d9539e649b193ae573b77a71c83",
"iso_url": "iso/en_windows_7_ultimate_with_sp1_x64_dvd_u_677332.iso",
"template": "windows-7"
}
}
Loading

0 comments on commit c21e1a3

Please sign in to comment.