Skip to content

Instantly share code, notes, and snippets.

@jonmosco
Created September 22, 2017 15:09
Show Gist options
  • Save jonmosco/95f724a7d4249a1cf046362669fa96fc to your computer and use it in GitHub Desktop.
Save jonmosco/95f724a7d4249a1cf046362669fa96fc to your computer and use it in GitHub Desktop.
{
"variables":
{
"provisioner": "vmware",
"vsphere_password": "",
"template_name": "ubuntu-16.04-x86_64",
"template_os": "ubuntu-64",
"iso_url": "/Users/jmosco/iso/linux/ubuntu-16.04.3-server-amd64.iso",
"iso_checksum": "a06cd926f5855d4f21fb4bc9978a35312f815fbda0d0ef7fdc846861f4fc4600",
"iso_checksum_type": "sha256",
"memory_size": "512",
"cpu_count": "1"
},
"builders": [
{
"name": "{{user `template_name`}}",
"type": "vmware-iso",
"headless": true,
"boot_command": [
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
" /install/vmlinuz auto <wait>",
" console-setup/ask_detect=false <wait>",
" console-setup/layoutcode=us <wait>",
" console-setup/modelcode=pc105 <wait>",
" debconf/frontend=noninteractive <wait>",
" debian-installer=en_US <wait>",
" fb=false <wait>",
" initrd=/install/initrd.gz <wait>",
" kbd-chooser/method=us <wait>",
" keyboard-configuration/layout=USA <wait>",
" keyboard-configuration/variant=USA <wait>",
"locale=en_US.UTF-8 <wait>",
" netcfg/get_domain=vm <wait>",
" netcfg/get_hostname=localhost <wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" noapic <wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
" -- <wait>",
"<enter>"
],
"boot_wait": "45s",
"disk_size": "40960",
"guest_os_type": "{{user `template_os`}}",
"http_directory": "files",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "root",
"ssh_password": "",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "/sbin/halt -h -p",
"tools_upload_flavor": "linux",
"vmx_data": {
"cpuid.coresPerSocket": "1",
"memsize": "{{user `memory_size`}}",
"numvcpus": "{{user `cpu_count`}}"
}
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"./scripts/puppet-agent.sh",
"./scripts/vmtools.sh",
"./scripts/cleanup.sh"
]
}
],
"post-processors": [
[ {
"type": "vsphere",
"cluster": "FP",
"datacenter": "FP",
"datastore": "datastore",
"disk_mode": "thin",
"host": "vc01.domain.com",
"password": "{{user `vsphere_password`}}",
"username": "root",
"vm_name": "{{user `template_name`}}",
"vm_folder": "packer_templates",
"insecure": true,
"overwrite": true
},
{
"type": "vsphere-template",
"password": "{{user `vsphere_password`}}",
"username": "root",
"host": "vc01.domain.com",
"datacenter": "FP",
"insecure": true
} ]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment