Last active
May 20, 2018 18:58
-
-
Save tvories/6881f6cfc7306bc035b41990e75f0480 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"name": "packer-ubuntu-1804", | |
"build_cpu_cores": "2", | |
"build_memory": "1024", | |
"cpu_cores": "1", | |
"memory": "512", | |
"disk_size": "20480", | |
"headless": "false", | |
"vm_hardware_version": "10", | |
"iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/ubuntu-18.04-server-amd64.iso", | |
"iso_checksum": "A7F5C7B0CDD0E9560D78F1E47660E066353BB8A79EB78D1FC3F4EA62A07E6CBC", | |
"iso_checksum_type": "sha256", | |
"ssh_username": "vagrant", | |
"ssh_password": "vagrant", | |
"ssh_timeout": "60m", | |
"cluster": "***", | |
"datacenter": "***", | |
"datastore": "***", | |
"host": "vcenter", | |
"vsphere_username": "un", | |
"vsphere_password": "pw", | |
"disk_mode": "thin", | |
"vm_network": "LAN" | |
}, | |
"builders": [{ | |
"type": "vmware-iso", | |
"guest_os_type": "Ubuntu-64", | |
"iso_url": "{{user `iso_url`}}", | |
"iso_checksum": "{{user `iso_checksum`}}", | |
"iso_checksum_type": "{{user `iso_checksum_type`}}", | |
"output_directory": "output-ubuntu1804-{{build_type}}", | |
"vm_name": "packer-ubuntu-1804", | |
"version": "{{user `vm_hardware_version`}}", | |
"disk_size": "{{user `disk_size`}}", | |
"headless": "{{user `headless`}}", | |
"http_directory": "http", | |
"boot_wait": "10s", | |
"boot_command": [ | |
"<esc><wait>", | |
"<esc><wait>", | |
"<enter><wait>", | |
"/install/vmlinuz<wait>", | |
" 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<wait>", | |
" netcfg/get_domain=vm<wait>", | |
" netcfg/get_hostname=vagrant<wait>", | |
" grub-installer/bootdev=/dev/sda<wait>", | |
" noapic<wait>", | |
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", | |
" -- <wait>", | |
"<enter><wait>" | |
], | |
"ssh_timeout": "{{user `ssh_timeout`}}", | |
"ssh_username": "{{user `ssh_username`}}", | |
"ssh_password": "{{user `ssh_password`}}", | |
"ssh_port": 22, | |
"ssh_wait_timeout": "10000s", | |
"ssh_pty": "true", | |
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", | |
"vmx_data": { | |
"memsize": "{{user `memory`}}", | |
"numvcpus": "{{user `cpu_cores`}}" | |
} | |
}], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"scripts": [ | |
"scripts/apt.sh", | |
"scripts/cleanup.sh", | |
"scripts/vmware.sh", | |
"scripts/python.sh", | |
"scripts/ansible.sh" | |
] | |
}], | |
"post-processors": [{ | |
"type": "vsphere", | |
"cluster": "{{user `cluster`}}", | |
"datacenter": "{{user `datacenter`}}", | |
"datastore": "{{user `datastore`}}", | |
"host": "{{user `host`}}", | |
"username": "{{user `vsphere_username`}}", | |
"password": "{{user `vsphere_password`}}", | |
"vm_name": "{{user `name`}}", | |
"disk_mode": "{{user `disk_mode`}}", | |
"vm_network": "{{user `vm_network`}}", | |
"options": [ | |
"--noSSLVerify" | |
] | |
}] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment