Created
February 16, 2020 14:05
-
-
Save lamw/b4ea5dc271da02ec2289205db7198641 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": { | |
"photon_ovf_template": "photon.xml.template", | |
"ovftool_deploy_vcenter": "192.168.30.200", | |
"ovftool_deploy_vcenter_username": "administrator@vsphere.local", | |
"ovftool_deploy_vcenter_password": "VMware1!" | |
}, | |
"builders": [ | |
{ | |
"type": "vsphere-iso", | |
"vm_name": "{{ user `vm_name` }}", | |
"guest_os_type": "otherGuest", | |
"vm_version": "13", | |
"disk_size": "12288", | |
"CPUs": "{{ user `numvcpus` }}", | |
"RAM": "{{ user `ramsize` }}", | |
"firmware": "bios", | |
"disk_thin_provisioned": true, | |
"network_card": "vmxnet3", | |
"network": "{{ user `builder_host_portgroup` }}", | |
"iso_paths": [ | |
"[{{ user `builder_host_datastore` }}] packer_cache/a3b59ec87af86d5595419065d04f73f156ad4cfe.iso" | |
], | |
"boot_command": [ | |
"<esc><wait>", | |
"vmlinuz initrd=initrd.img root=/dev/ram0 loglevel=3 ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/photon-kickstart.json photon.media=cdrom", | |
"<enter>" | |
], | |
"boot_wait": "10s", | |
"iso_url": "{{ user `iso_url` }}", | |
"iso_checksum": "{{ user `iso_checksum` }}", | |
"iso_checksum_type": "{{ user `iso_checksum_type` }}", | |
"http_directory": "http", | |
"vcenter_server": "{{ user `builder_host` }}", | |
"insecure_connection": true, | |
"username": "{{ user `builder_host_username` }}", | |
"password": "{{ user `builder_host_password` }}", | |
"datacenter": "{{ user `builder_host_datacenter` }}", | |
"cluster": "{{ user `builder_host_cluster` }}", | |
"datastore": "{{ user `builder_host_datastore` }}", | |
"ssh_username": "{{ user `guest_username` }}", | |
"ssh_password": "{{ user `guest_password` }}", | |
"ssh_port": 22, | |
"shutdown_command": "/sbin/shutdown -h now", | |
"shutdown_timeout": "1000s", | |
"format": "ovf" | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"scripts": [ | |
"scripts/photon-settings.sh", | |
"scripts/photon-cleanup.sh" | |
] | |
}, | |
{ | |
"type": "file", | |
"source": "files/rc.local", | |
"destination": "/etc/rc.d/rc.local" | |
}, | |
{ | |
"type": "file", | |
"source": "files/setup.sh", | |
"destination": "/root/setup.sh" | |
} | |
], | |
"post-processors": [ | |
{ | |
"type": "shell-local", | |
"environment_vars": ["PHOTON_VERSION={{ user `version` }}", "PHOTON_APPLIANCE_NAME={{ user `vm_name` }}", "FINAL_PHOTON_APPLIANCE_NAME={{ user `vm_name` }}_{{user `version`}}", "PHOTON_OVF_TEMPLATE={{ user `photon_ovf_template` }}"], | |
"inline": [ | |
"cd manual", | |
"./add_ovf_properties.sh" | |
] | |
}, | |
{ | |
"type": "shell-local", | |
"inline": [ | |
"pwsh -F unregister_vm.ps1 {{ user `ovftool_deploy_vcenter` }} {{ user `ovftool_deploy_vcenter_username` }} {{ user `ovftool_deploy_vcenter_password` }} {{ user `vm_name` }}" | |
] | |
} | |
] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment