Vasyl Saienko | 9740a4f | 2023-09-22 14:48:29 +0000 | [diff] [blame] | 1 | { |
| 2 | "variables": { |
| 3 | "user": "root", |
| 4 | "password": "r00tme", |
| 5 | "disk_size": "2500M", |
| 6 | "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}", |
| 7 | "image_base_url": "{{ env `IMAGE_BASE_URL` }}", |
| 8 | "image_md5_url": "{{ env `IMAGE_MD5_URL` }}", |
Vasyl Saienko | ab3cead | 2023-09-24 14:25:37 +0000 | [diff] [blame^] | 9 | "vm_name": "{{ env `VM_NAME` }}", |
| 10 | "kernel_version": "{{ env `KERNEL_VERSION` }}" |
Vasyl Saienko | 9740a4f | 2023-09-22 14:48:29 +0000 | [diff] [blame] | 11 | }, |
| 12 | "provisioners": [ |
| 13 | { |
| 14 | "type": "shell", |
Vasyl Saienko | ab3cead | 2023-09-24 14:25:37 +0000 | [diff] [blame^] | 15 | "environment_vars": [ |
| 16 | "KERNEL_VERSION={{user `kernel_version`}}" |
| 17 | ], |
Vasyl Saienko | 9740a4f | 2023-09-22 14:48:29 +0000 | [diff] [blame] | 18 | "scripts": [ |
| 19 | "scripts/apt.sh", |
| 20 | "scripts/cleanup.sh" |
| 21 | ] |
| 22 | } |
| 23 | ], |
| 24 | "builders": [ |
| 25 | { |
| 26 | "type": "qemu", |
| 27 | "qemuargs": [ |
| 28 | [ |
| 29 | "-m", |
| 30 | "8096M" |
| 31 | ], |
| 32 | [ |
| 33 | "-smp", |
| 34 | "4" |
| 35 | ], |
| 36 | [ |
| 37 | "-cdrom", |
| 38 | "config-drive/cloudata.iso" |
| 39 | ], |
| 40 | ["-device", "virtio-net,netdev=user.0"], |
| 41 | ["-object","rng-random,id=objrng0,filename=/dev/urandom"], |
| 42 | ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10" ] |
| 43 | ], |
| 44 | "vm_name": "{{user `vm_name`}}", |
| 45 | "output_directory": "images", |
| 46 | "disk_compression": true, |
| 47 | "disk_size": "{{ user `disk_size`}}", |
| 48 | "format": "qcow2", |
| 49 | "iso_url": "{{ user `image_base_url`}}", |
| 50 | "iso_checksum": "file:{{ user `image_md5_url`}}", |
| 51 | "iso_target_path": "{{ user `images_cache`}}", |
| 52 | "disk_image": true, |
| 53 | "accelerator": "kvm", |
| 54 | "headless": true, |
| 55 | "ssh_username": "{{user `user`}}", |
| 56 | "ssh_password": "{{user `password`}}", |
| 57 | "ssh_host_port_min": 7000, |
| 58 | "ssh_host_port_max": 7050, |
| 59 | "vnc_port_max": "5956", |
| 60 | "vnc_port_min": "5956", |
| 61 | "shutdown_command": "shutdown -P now", |
| 62 | "boot_wait": "10s", |
| 63 | "ssh_wait_timeout": "360s" |
| 64 | } |
| 65 | ] |
| 66 | } |