Skip to content

Instantly share code, notes, and snippets.

@joeypiccola
Created October 18, 2019 21:28
Show Gist options
  • Save joeypiccola/21125879d269ad5bf3aa95bdf87602d9 to your computer and use it in GitHub Desktop.
Save joeypiccola/21125879d269ad5bf3aa95bdf87602d9 to your computer and use it in GitHub Desktop.
{
"variables": {
"name": "2019-packer",
"guest_os_type": "windows9_64Guest",
"iso_checksum": "7B463563206DCE275F2D3FF77AC36C430052FAE161CD4F8B31F3DC7AF1C3F418",
"iso_url": "file://D:\\ISOs\\en_windows_server_2019_x64_dvd_3c2cf1202.iso",
"iso_path": "[freenas_datastore_0] ISO/en_windows_server_2019_x64_dvd_3c2cf1202.iso",
"iso_checksum_type": "sha256",
"answerfile": "answer_files/2019/vsphere/Autounattend.xml",
"disk_size": "30720",
"vm_hardware_version": "13",
"esxi_host": "esxi-3.piccola.us",
"datastore": "freenas_datastore_0",
"vcenter_server": "vcenter.ad.piccola.us",
"insecure_connection": "true",
"vcenter_username": "-",
"vcenter_password": "-",
"datacenter": "Basement",
"folder": "Templates",
"cluster": "BC1",
"network": "VLAN3_primary_LAN"
},
"builders": [
{
"type": "vsphere-iso",
"vm_name": "{{ user `name` }}",
"iso_paths": [
"[freenas_datastore_0] iso/en_windows_server_2019_x64_dvd_3c2cf1202.iso",
"[freenas_datastore_0] iso/VMware-tools-windows-10.3.5-10430147.iso"
],
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "{{ user `iso_checksum_type` }}",
"communicator": "winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "12h",
"winrm_port": "5985",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_timeout": "15m",
"guest_os_type": "{{ user `guest_os_type` }}",
"vm_version": "{{ user `vm_hardware_version` }}",
"CPUs": 2,
"cpu_cores": 2,
"CPU_hot_plug": true,
"RAM": 4096,
"RAM_hot_plug": true,
"network": "{{ user `network` }}",
"disk_size": "{{ user `disk_size` }}",
"disk_thin_provisioned": true,
"disk_controller_type": "pvscsi",
"network_card": "vmxnet3",
"convert_to_template": true,
"vcenter_server": "{{ user `vcenter_server` }}",
"insecure_connection": "{{ user `insecure_connection` }}",
"username": "{{ user `vcenter_username`}}",
"password": "{{ user `vcenter_password` }}",
"host": "{{ user `esxi_host` }}",
"cluster": "{{ user `cluster` }}",
"datastore": "{{ user `datastore` }}",
"folder": "{{ user `folder` }}",
"floppy_files": [
"{{ user `answerfile` }}",
"scripts/Set-WinRM.ps1",
"scripts/winrm.bat",
"drivers/",
"scripts/Install-VMwareToolsVsphere.ps1"
]
}],
"provisioners": [{
"type": "powershell",
"elevated_user": "vagrant",
"elevated_password": "vagrant",
"scripts": [
"scripts/Disable-UAC.ps1",
"scripts/Install-Net35.ps1",
"scripts/Set-WinRM.ps1"
]
},
{
"type": "windows-restart"
},
{
"type": "powershell",
"scripts": [
"scripts/Install-Nuget.ps1"
]
},
{
"type": "powershell",
"scripts": [
"scripts/Remove-UpdateCache.ps1",
"scripts/Remove-PackerScheduledTasks.ps1",
"scripts/Invoke-Defrag.ps1",
"scripts/Reset-EmptySpace.ps1"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment