Skip to content

Instantly share code, notes, and snippets.

@mikejr83
Created August 3, 2017 15:42
Show Gist options
  • Save mikejr83/693ada2b7e4446991aeb9781eeb07f4b to your computer and use it in GitHub Desktop.
Save mikejr83/693ada2b7e4446991aeb9781eeb07f4b to your computer and use it in GitHub Desktop.
Packer.io Hyper-V template for nodejs Ubuntu 16.04 LTS Server
{
"variables": {
"public_port": "3000",
"vm_name": "nodejs_microservice_host",
"cpu": "2",
"ram_size": "1024",
"disk_size": "21440",
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso",
"iso_checksum": "10fcd20619dce11fe094e960c85ba4a9",
"iso_checksum_type": "md5"
},
"builders": [{
"vm_name": "{{user `vm_name`}}",
"type": "hyperv-iso",
"disk_size": "{{user `disk_size`}}",
"guest_additions_mode": "disable",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"communicator": "ssh",
"ssh_username": "packer",
"ssh_password": "packer",
"ssh_timeout": "4h",
"http_directory": "./",
"boot_wait": "5s",
"boot_command": [
"<esc><wait10><esc><esc><enter><wait>",
"set gfxpayload=1024x768<enter>",
"linux /install/vmlinuz ",
"preseed/url=http://{{.HTTPIP}}:{{.HTTPPort}}/hyperv-taliesins.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{.Name}} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false <enter>",
"initrd /install/initrd.gz<enter>",
"boot<enter>"
],
"shutdown_command": "echo 'packer' | sudo -S -E shutdown -P now",
"ram_size": "{{user `ram_size`}}",
"cpu": "{{user `cpu`}}",
"generation": 2,
"enable_secure_boot": false
}],
"provisioners": [{
"type": "shell",
"inline": [
"sleep 30",
"curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -",
"sudo apt-get update",
"sudo apt-get install -y nodejs build-essential ngnix"
]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment