Skip to content

Instantly share code, notes, and snippets.

@jonmosco
Created March 16, 2017 16:36
Show Gist options
  • Save jonmosco/c79d56c59807b700efc59117993e94e4 to your computer and use it in GitHub Desktop.
Save jonmosco/c79d56c59807b700efc59117993e94e4 to your computer and use it in GitHub Desktop.
{
"variables": {
"builder_ssh_password": "",
"vsphere_password": "",
"builder_vm_template_name": "",
"post_vm_template_name": "",
"headless": "true",
"iso_checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f",
"iso_checksum_type": "sha256",
"iso_url": "/opt/iso/rhel-server-7.3-x86_64-dvd.iso",
"ks_path": "rhel-7.3/el7-kickstart.cfg",
"template": "rhel-7.3-x86_64"
},
"builders": [
{
"type": "vmware-iso",
"version": "10",
"headless": "{{user `headless`}}",
"http_directory": "http",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"ssh_username": "root",
"ssh_password": "{{user `builder_ssh_password`}}",
"guest_os_type": "rhel7-64",
"vm_name": "{{user `builder_vm_template_name`}}",
"ssh_wait_timeout": "1000s",
"vmx_data": {
"memsize": "2048",
"numvcpus": "2",
"cpuid.coresPerSocket": "1"
},
"vmx_data_post": {
"ethernet0.present": "true",
"ethernet0.virtualdev": "vmxnet3",
"ethernet0.startConnected": "true",
"ethernet0.networkName": "VLAN4"
},
"shutdown_command": "/usr/bin/sudo /sbin/halt -h -p",
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `ks_path`}}<enter><wait>"
]
}
],
"post-processors": [
{
"type": "vsphere",
"cluster": "",
"datacenter": "",
"host": "",
"username": "",
"password": "{{user `vsphere_password`}}",
"resource_pool": "BuildTemplates",
"vm_name": "{{user `post_vm_template_name`}}",
"vm_folder": "Templates",
"datastore": "",
"insecure": true,
"keep_input_artifact": false
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/cleanup.sh",
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment