Last active
August 10, 2017 20:32
-
-
Save bugbuilder/66aacf9f47cb1c143f7b9f235b329c13 to your computer and use it in GitHub Desktop.
packer-drone
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
pipeline: | |
esxi_ssh_enabled: | |
image: bennu/govc | |
environment: | |
- GOVC_INSECURE=true | |
commands: | |
- govc host.service --host $ESXI_HOST start TSM-SSH | |
secrets: [ govc_url, govc_username, govc_password, esxi_host ] | |
packer: | |
image: bennu/packer | |
commands: | |
- packer build --force template.json | |
secrets: [ vsphere_host, vsphere_insecure, vsphere_username, vsphere_password, esxi_host, esxi_username, esxi_password, esxi_datastore ] | |
esxi_ssh_disable: | |
image: bennu/govc | |
environment: | |
- GOVC_INSECURE=true | |
commands: | |
- govc host.service --host $ESXI_HOST stop TSM-SSH | |
secrets: [ govc_url, govc_username, govc_password, esxi_host ] | |
when: | |
status: [ failure, success ] |
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
{ | |
"builders":[ | |
{ | |
"type":"vmware-iso", | |
"guest_os_type":"rhel7-64", | |
"output_directory":"template-{{user `vm_name`}}", | |
"vnc_disable_password":true, | |
"floppy_files":[ | |
"floppy/ks.cfg" | |
], | |
"boot_command":"<tab> inst.text inst.ks=hd:fd0:/ks.cfg <enter><wait>", | |
"boot_wait":"10s", | |
"shutdown_command":"echo 'user' | sudo -S /sbin/halt -h -p", | |
"disk_size":"{{user `disk_size`}}", | |
"disk_type_id":"{{user `disk_type`}}", | |
"iso_checksum":"{{user `iso_checksum`}}", | |
"iso_checksum_type":"{{user `iso_checksum_type`}}", | |
"iso_url":"{{user `mirror`}}{{user `directory`}}/{{user `iso_name`}}", | |
"ssh_port":22, | |
"ssh_username":"user", | |
"ssh_password":"user", | |
"ssh_wait_timeout":"10000s", | |
"remote_type":"esx5", | |
"remote_host":"{{user `esxi_host`}}", | |
"remote_datastore":"{{user `esxi_datastore`}}", | |
"remote_username":"{{user `esxi_username`}}", | |
"remote_password":"{{user `esxi_password`}}", | |
"keep_registered":true, | |
"vm_name":"{{ user `vm_name` }}", | |
"vmx_data":{ | |
"cpuid.coresPerSocket":"{{ user `coresPerSocket` }}", | |
"memsize":"{{ user `memory` }}", | |
"numvcpus":"{{ user `cpus` }}", | |
"ethernet0.networkName":"{{user `network`}}", | |
"ethernet0.present":"TRUE", | |
"ethernet0.startConnected":"TRUE", | |
"ethernet0.virtualDev":"vmxnet3", | |
"ethernet0.addressType":"generated", | |
"ethernet0.generatedAddressOffset":"0", | |
"ethernet0.wakeOnPcktRcv":"FALSE" | |
} | |
} | |
], | |
"provisioners":[ | |
], | |
"post-processors":[ | |
{ | |
"type":"vsphere-template", | |
"host":"{{user `vsphere_host`}}", | |
"insecure":"{{user `vsphere_insecure`}}", | |
"username":"{{user `vsphere_username`}}", | |
"password":"{{user `vsphere_password`}}", | |
"vm_name":"{{user `vm_name`}}", | |
"datacenter":"{{user `datacenter`}}", | |
"folder":"{{user `folder`}}" | |
} | |
], | |
"variables": { | |
"esxi_host":"{{env `ESXI_HOST`}}", | |
"esxi_datastore":"{{env `ESXI_DATASTORE`}}", | |
"esxi_username":"{{env `ESXI_USER`}}", | |
"esxi_password":"{{env `ESXI_PASSWORD`}}", | |
"vsphere_host":"{{env `VSPHERE_HOST`}}", | |
"vsphere_insecure": "{{env `VSPHERE_INSECURE`}}", | |
"vsphere_username":"{{env `VSPHERE_USERNAME`}}", | |
"vsphere_password":"{{env `VSPHERE_PASSWORD`}}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment