Skip to content

Instantly share code, notes, and snippets.

@DarrenF-G
Created September 21, 2020 20:03
Show Gist options
  • Save DarrenF-G/17753bd304235539877c1c423d9cbaad to your computer and use it in GitHub Desktop.
Save DarrenF-G/17753bd304235539877c1c423d9cbaad to your computer and use it in GitHub Desktop.
{
"builders": [
{
"CPUs": "{{user `vm-cpu-num`}}",
"CPU_hot_plug": true,
"RAM": "{{user `vm-mem-size`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"RAM_hot_plug": true,
"RAM_reserve_all": true,
"host": "{{user `vsphere-host`}}",
"http_directory": "./packer-vsphere-iso-windows/data/",
"vm_version": "10",
"video_ram": "16384",
"datacenter": "{{user `vsphere-datacenter`}}",
"communicator": "winrm",
"convert_to_template": "false",
"datastore": "{{user `vsphere-datastore`}}",
"disk_controller_type": "lsilogic-sas",
"firmware": "bios",
"floppy_files":[
"./packer-vsphere-iso-windows/win10.base/autounattend.xml"
],
"floppy_dirs":[
"./packer-vsphere-iso-windows/scripts"
],
"folder": "{{user `vsphere-folder`}}",
"guest_os_type": "windows9_64Guest",
"insecure_connection": "true",
"iso_paths": [
"[] /vmimages/tools-isoimages/windows.iso"
],
"network_adapters": [
{
"network": "{{user `vsphere-network`}}",
"network_card": "vmxnet3"
}
],
"password": "{{user `vsphere-password`}}",
"storage": [
{
"disk_size": "{{user `vm-disk-size`}}",
"disk_thin_provisioned": false
}
],
"type": "vsphere-iso",
"username": "{{user `vsphere-user`}}",
"vcenter_server": "{{user `vsphere-server`}}",
"vm_name": "{{user `vm-name`}}",
"winrm_password": "{{user `winadmin-password`}}",
"winrm_username": "Administrator"
}
],
"provisioners": [
{
"type": "file",
"source": "./packer-vsphere-iso-windows/scripts/",
"destination": "c:\\Temp"
},
{
"type": "powershell",
"scripts": [
"./packer-vsphere-iso-windows/scripts/download-data-folder.ps1
]
},
{
"type": "powershell",
"inline": [
"iwr -uri http://$ENV:PACKER_HTTP_ADDR/Check_MK/check_mk_agent.msi -outfile c:/temp/check_mk/check_mk_agent.msi ",
"c:/temp/install-checkmk.ps1"
]
},
],
"sensitive-variables": [
"vsphere_password",
"winadmin_password"
],
"variables": {
"vm-cpu-num": "8",
"vm-disk-size": "40960",
"vm-mem-size": "8192",
"vm-name": "Win10-test",
"vsphere-datacenter": "Home-Lab",
"vsphere-datastore": "NVME_esxi",
"vsphere-host": "esxi.home.local",
"vsphere-folder": "infra",
"vsphere-network": "VM Network",
"vsphere-password": "",
"vsphere-server": "vsphere.home.local",
"vsphere-user": "vsphere.home.local\\",
"winadmin-password": "",
"iso_url": "./packer-vsphere-iso-windows/isos/windows10_ent.iso",
"iso_checksum": "2B51705E4AF1D2B2D3FE329370A333FD",
"winrm_timeout": "6h"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment