Oleh Hryhorov | ac5f601 | 2021-03-05 18:26:25 +0200 | [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` }}", |
Oleksandr Kononenko | 231933b | 2024-02-05 16:46:35 +0200 | [diff] [blame] | 9 | "vm_name": "{{ env `VM_NAME` }}", |
Oleksandr Kononenko | 98ef1c0 | 2025-05-12 20:19:04 +0300 | [diff] [blame] | 10 | "inventory_file": "{{ env `INVENTORY_FILE` }}" |
Oleh Hryhorov | ac5f601 | 2021-03-05 18:26:25 +0200 | [diff] [blame] | 11 | }, |
| 12 | "provisioners": [ |
| 13 | { |
Oleksandr Kononenko | 231933b | 2024-02-05 16:46:35 +0200 | [diff] [blame] | 14 | "type": "shell", |
Oleksandr Kononenko | 98ef1c0 | 2025-05-12 20:19:04 +0300 | [diff] [blame] | 15 | "inline": [ |
| 16 | "mkdir -p /usr/share/trymos /srv" |
Oleksandr Kononenko | 231933b | 2024-02-05 16:46:35 +0200 | [diff] [blame] | 17 | ] |
| 18 | }, |
| 19 | { |
Oleh Hryhorov | ac5f601 | 2021-03-05 18:26:25 +0200 | [diff] [blame] | 20 | "type": "file", |
Oleksandr Kononenko | 98ef1c0 | 2025-05-12 20:19:04 +0300 | [diff] [blame] | 21 | "source": "{{user `inventory_file`}}", |
| 22 | "destination": "/srv/single_node.yaml" |
| 23 | }, |
| 24 | { |
| 25 | "type": "file", |
| 26 | "source": "../rockoon/charts", |
Oleh Hryhorov | ac5f601 | 2021-03-05 18:26:25 +0200 | [diff] [blame] | 27 | "destination": "/srv/" |
| 28 | }, |
| 29 | { |
| 30 | "type": "file", |
Oleksandr Kononenko | 98ef1c0 | 2025-05-12 20:19:04 +0300 | [diff] [blame] | 31 | "source": "../rockoon/virtual_lab", |
Oleh Hryhorov | ac5f601 | 2021-03-05 18:26:25 +0200 | [diff] [blame] | 32 | "destination": "/srv/" |
| 33 | }, |
| 34 | { |
| 35 | "type": "file", |
Oleksandr Kononenko | 98ef1c0 | 2025-05-12 20:19:04 +0300 | [diff] [blame] | 36 | "source": "./scripts/launch.sh", |
| 37 | "destination": "/usr/share/trymos/" |
Oleh Hryhorov | ac5f601 | 2021-03-05 18:26:25 +0200 | [diff] [blame] | 38 | } |
| 39 | ], |
| 40 | "builders": [ |
| 41 | { |
| 42 | "type": "qemu", |
| 43 | "qemuargs": [ |
| 44 | [ |
| 45 | "-m", |
Oleksandr Kononenko | 98ef1c0 | 2025-05-12 20:19:04 +0300 | [diff] [blame] | 46 | "4096M" |
Oleh Hryhorov | ac5f601 | 2021-03-05 18:26:25 +0200 | [diff] [blame] | 47 | ], |
| 48 | [ |
| 49 | "-smp", |
| 50 | "4" |
| 51 | ], |
| 52 | [ |
| 53 | "-cdrom", |
| 54 | "config-drive/cloudata.iso" |
| 55 | ], |
| 56 | ["-device", "virtio-net,netdev=user.0"], |
| 57 | ["-object","rng-random,id=objrng0,filename=/dev/urandom"], |
| 58 | ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10" ] |
| 59 | ], |
| 60 | "vm_name": "{{user `vm_name`}}", |
| 61 | "output_directory": "images", |
| 62 | "disk_compression": true, |
| 63 | "disk_size": "{{ user `disk_size`}}", |
| 64 | "format": "qcow2", |
| 65 | "iso_url": "{{ user `image_base_url`}}", |
| 66 | "iso_checksum": "file:{{ user `image_md5_url`}}", |
| 67 | "iso_target_path": "{{ user `images_cache`}}", |
| 68 | "disk_image": true, |
| 69 | "accelerator": "kvm", |
| 70 | "headless": true, |
| 71 | "ssh_username": "{{user `user`}}", |
| 72 | "ssh_password": "{{user `password`}}", |
| 73 | "ssh_host_port_min": 7000, |
| 74 | "ssh_host_port_max": 7050, |
| 75 | "vnc_port_max": "5956", |
| 76 | "vnc_port_min": "5956", |
Vasyl Saienko | 057953f | 2023-11-27 12:45:27 +0000 | [diff] [blame] | 77 | "shutdown_command": "passwd -d root; rm -rf /etc/sudoers.d/90-cloud-init-users; /sbin/shutdown -P now", |
Oleh Hryhorov | ac5f601 | 2021-03-05 18:26:25 +0200 | [diff] [blame] | 78 | "boot_wait": "10s", |
| 79 | "ssh_wait_timeout": "360s" |
| 80 | } |
| 81 | ] |
| 82 | } |