Dennis Dmitriev | 056ecbf | 2019-05-20 15:36:29 +0300 | [diff] [blame] | 1 | { |
| 2 | "variables": { |
| 3 | "vm_name": "{{ env `IMAGE_NAME` }}.qcow2", |
| 4 | "image_path": "tmp/{{ env `IMAGE_NAME` }}", |
| 5 | "base_image_url": "{{ env `BASE_IMAGE_URL` }}", |
| 6 | "base_image_md5": "{{ env `BASE_IMAGE_MD5` }}", |
| 7 | "base_image_path": "base_image.qcow2", |
| 8 | "ssh_username": "root", |
| 9 | "ssh_password": "r00tme", |
| 10 | "ssh_wait_timeout": "30m", |
| 11 | "disk_size": "51200", |
| 12 | "boot_wait": "120s" |
| 13 | }, |
| 14 | |
| 15 | "builders": |
| 16 | [ |
| 17 | { |
| 18 | "type": "qemu", |
| 19 | "qemuargs": [ |
| 20 | [ "-m", "1024M" ], |
| 21 | [ "-cdrom", "tmp/config-drive.iso" ], |
| 22 | ["-device", "virtio-net,netdev=user.0"], |
| 23 | ["-object","rng-random,id=objrng0,filename=/dev/urandom"], |
| 24 | ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10" ] |
| 25 | ], |
| 26 | "vm_name": "{{ user `vm_name` }}", |
| 27 | "output_directory": "{{ user `image_path` }}", |
| 28 | "format": "qcow2", |
| 29 | "iso_url": "{{ user `base_image_url` }}", |
| 30 | "iso_checksum": "{{ user `base_image_md5` }}", |
| 31 | "iso_checksum_type": "md5", |
| 32 | "iso_target_path": "{{ user `base_image_path`}}", |
| 33 | "disk_image": true, |
| 34 | "disk_compression": true, |
| 35 | "accelerator": "kvm", |
| 36 | "disk_size": "{{ user `disk_size`}}", |
| 37 | "headless": true, |
| 38 | "ssh_username": "{{ user `ssh_username` }}", |
| 39 | "ssh_password": "{{ user `ssh_password` }}", |
| 40 | "ssh_wait_timeout": "{{ user `ssh_wait_timeout` }}", |
| 41 | "ssh_host_port_min": 7000, |
| 42 | "ssh_host_port_max": 7050, |
| 43 | "shutdown_command": "shutdown -P now", |
| 44 | "boot_wait": "{{ user `boot_wait` }}" |
| 45 | } |
| 46 | ], |
| 47 | |
| 48 | "provisioners": [ |
| 49 | { |
| 50 | "type": "shell", |
| 51 | "environment_vars": [ |
| 52 | "DEBIAN_FRONTEND=noninteractive" |
| 53 | ], |
| 54 | "execute_command": "echo '{{ user `ssh_password` }}' | {{.Vars}} sudo -S -E bash -x '{{.Path}}'", |
| 55 | "scripts": [ |
| 56 | "tcp_tests/templates/_packer/scripts/ubuntu_packets.sh", |
| 57 | "tcp_tests/templates/_packer/scripts/ubuntu_ldap.sh", |
| 58 | "tcp_tests/templates/_packer/scripts/jenkins_virtualenvs.sh", |
| 59 | "tcp_tests/templates/_packer/scripts/ubuntu_cleanup.sh", |
| 60 | "tcp_tests/templates/_packer/scripts/zerodisk.sh" |
| 61 | ] |
| 62 | } |
| 63 | ] |
| 64 | } |