Skip to content

Instantly share code, notes, and snippets.

@mindrunner
Created June 28, 2017 12:04
Show Gist options
  • Save mindrunner/369bd841277984d5e1322c478916cb26 to your computer and use it in GitHub Desktop.
Save mindrunner/369bd841277984d5e1322c478916cb26 to your computer and use it in GitHub Desktop.
{
"builders": [
{
"boot_wait": "2s",
"disk_size": 102400,
"guest_os_type": "darwin12-64",
"iso_checksum_type": "sha1",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"output_directory": "{{user `output_directory`}}",
"shutdown_command": "echo '{{user `username`}}'|sudo -S shutdown -h now",
"skip_compaction": false,
"ssh_port": 22,
"ssh_username": "{{user `username`}}",
"ssh_password": "{{user `password`}}",
"ssh_wait_timeout": "10000s",
"tools_upload_flavor": "darwin",
"type": "vmware-iso",
"vmx_data": {
"cpuid.coresPerSocket": "1",
"memsize": "2048",
"numvcpus": "4",
"firmware": "efi",
"keyboardAndMouseProfile": "macProfile",
"smc.present": "TRUE",
"hpet0.present": "TRUE",
"ich7m.present": "TRUE",
"ehci.present": "TRUE",
"usb.present": "TRUE"
}
}
],
"min_packer_version": "0.7.0",
"post-processors": [
"vagrant"
],
"provisioners": [
{
"type": "shell-local",
"command": "sleep {{user `provisioning_delay`}}"
},
{
"destination": "/private/tmp/set_kcpassword.py",
"source": "../osx-vm-templates/scripts/support/set_kcpassword.py",
"type": "file"
},
{
"execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}",
"scripts": [
"../osx-vm-templates/scripts/vagrant.sh",
"../osx-vm-templates/scripts/vmware.sh",
"../osx-vm-templates/scripts/parallels.sh",
"../osx-vm-templates/scripts/xcode-cli-tools.sh",
"../osx-vm-templates/scripts/add-network-interface-detection.sh",
"../osx-vm-templates/scripts/autologin.sh",
"../osx-vm-templates/scripts/system-update.sh",
"../scripts/reboot.sh"
],
"environment_vars": [
"AUTOLOGIN={{user `autologin`}}",
"FACTER_VERSION={{user `facter_version`}}",
"HIERA_VERSION={{user `hiera_version`}}",
"INSTALL_VAGRANT_KEYS={{user `install_vagrant_keys`}}",
"NOCM={{user `nocm`}}",
"INSTALL_XCODE_CLI_TOOLS={{user `install_xcode_cli_tools`}}",
"PASSWORD={{user `password`}}",
"UPDATE_SYSTEM={{user `update_system`}}",
"USERNAME={{user `username`}}"
],
"type": "shell"
},
{
"type": "ansible",
"playbook_file": "../ansible/packer-minimal.yml",
"extra_arguments": ["-vvv", "--extra-vars", "@custom_env.json"],
"pause_before": "10s"
},
{
"execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}",
"scripts": [
"../osx-vm-templates/scripts/shrink.sh"
],
"type": "shell",
"expect_disconnect": "true"
}
],
"variables": {
"autologin": "true",
"install_vagrant_keys": "true",
"install_xcode_cli_tools": "true",
"iso_url": "https://server-for-osx-image/path-to-image/OSX_InstallESD_10.12.3_16D32.dmg",
"iso_checksum": "7e9034477773ffb909e25dd5ddb3e85cfcf6c7b7",
"password": "vagrant",
"provisioning_delay": "0",
"update_system": "true",
"username": "vagrant"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment