Skip to content

Instantly share code, notes, and snippets.

@fins2
Created December 6, 2019 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fins2/5a68a6d5425402f2cd1e70116a0f7a0a to your computer and use it in GitHub Desktop.
Save fins2/5a68a6d5425402f2cd1e70116a0f7a0a to your computer and use it in GitHub Desktop.
{
"variables": {
"serial": ""
},
"builders": [
{
"type": "qemu",
"accelerator": "kvm",
"communicator": "none",
"boot_command": ["<tab> console=ttyS0,115200n8 inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{ user `kickstart_file` }} rd.live.check=0<enter><wait>"],
"disk_size": "25000",
"format": "raw",
"iso_checksum_type": "{{ user `iso_checksum_type` }}",
"iso_checksum": "{{ user `iso_checksum`}}",
"iso_url": "{{ user `iso_url` }}",
"headless": "true",
"http_directory": "{{ user `kickstart_directory` }}",
"http_port_max": "10089",
"http_port_min": "10082",
"output_directory": "output",
"shutdown_timeout": "30m",
"vm_name": "disk.raw",
"qemu_binary": "/usr/libexec/qemu-kvm",
"qemuargs": [
[
"-m", "1024"
],
[
"-cpu", "host"
],
[
"-chardev", "tty,id=pts,path={{user `serial`}}"
],
[
"-device", "isa-serial,chardev=pts"
],
[
"-device", "virtio-net,netdev=user.0"
]
]
}
],
"provisioners": [
{
"type": "ansible",
"playbook_file": "./provisioners/ansible/playbook.yml",
"sftp_command": "/usr/libexec/openssh/sftp-server -e",
}
],
"post-processors": [
[
{
"type": "compress",
"output": "output/disk.raw.tar.gz"
},
{
"type": "googlecompute-import",
"project_id": "{{ user `project_id` }}",
"account_file": "{{ user `account_file` }}",
"bucket": "{{ user `bucket` }}",
"image_name": "{{ user `image_name` }}-{{ timestamp }}",
"image_description": "{{ user `image_description` }}",
"image_family": "{{ user `image_family` }}"
}
]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment