blob: 076fdec1ab2d9fb54c9a14106f3bb0840c1f2ad4 [file] [log] [blame]
{
"variables": {
"user": "root",
"password": "r00tme",
"disk_size": "5000",
"images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
"ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
"saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
"saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
"do_api_token": "{{ env `DO_API_TOKEN` }}",
"image_name": "{{ env `IMAGE_NAME` }}",
"os_username": "{{ env `OS_USERNAME` }}",
"os_password": "{{ env `OS_PASSWORD` }}",
"os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
"os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
"os_zone": "mcp-mk",
"os_floating_ip_pool": "public",
"os_tenant": "26e4dd19485249608ee3685f254f3909",
"os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
},
"provisioners": [
{
"type": "shell-local",
"command": "cp -av ../common/files/scripts/growlvm.py files/scripts/growlvm.py"
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"expect_disconnect": "true",
"environment_vars": [
"UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
"SALTSTACK_GPG={{ user `saltstack_gpg` }}",
"SALTSTACK_REPO={{ user `saltstack_repo` }}"
],
"override": {
"qemu": {
"scripts": [
"scripts/base.sh",
"scripts/motd.sh",
"scripts/salt.sh",
"scripts/network.sh",
"scripts/security.sh",
"scripts/cleanup.sh",
"scripts/info.sh",
"scripts/zerodisk.sh"
]
},
"openstack": {
"scripts": [
"scripts/base.sh",
"scripts/motd.sh",
"scripts/salt.sh",
"scripts/network.sh",
"scripts/security.sh",
"scripts/cleanup.sh",
"scripts/info.sh",
"scripts/zerodisk.sh"
]
}
}
},
{
"type": "file",
"source": "files/etc/",
"destination": "/etc"
},
{
"type": "file",
"source": "files/scripts/",
"destination": "/usr/bin"
}
],
"builders": [
{
"type": "qemu",
"qemuargs": [
["-m", "1024M"],
["-device", "virtio-net,netdev=user.0"],
["-object","rng-random,id=objrng0,filename=/dev/urandom"],
["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10"]
],
"vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2",
"output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
"disk_compression": true,
"disk_size": "{{ user `disk_size`}}",
"boot_key_interval": "50ms",
"accelerator": "kvm",
"iso_checksum": "24636fd103a2a43c95659f1c3c63718e",
"iso_checksum_type": "md5",
"iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso",
"iso_target_path": "{{ user `images_cache` }}/ubuntu-16.04.5-server-amd64.iso",
"http_directory": "http",
"headless": true,
"ssh_username": "{{user `user`}}",
"ssh_password": "{{user `password`}}",
"shutdown_command": "sync; sudo /sbin/shutdown -hP now",
"boot_wait": "2s",
"ssh_wait_timeout": "15m",
"ssh_host_port_min": 7050,
"ssh_host_port_max": 7060,
"boot_command": [
"<enter><wait><f6><esc>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US<wait>",
" fb=false<wait>",
" initrd=/install/initrd.gz<wait>",
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
" locale=en_US<wait>",
" netcfg/get_hostname=ubuntu<wait>",
" netcfg/get_domain=local<wait>",
" noapic<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
" -- <wait>",
"<enter><wait>"
]
},
{
"type": "openstack",
"ssh_username": "{{user `user`}}",
"ssh_password": "{{user `password`}}",
"image_name": "{{user `image_name`}}",
"floating_ip_pool": "{{user `os_floating_ip_pool`}}",
"reuse_ips": "true",
"source_image": "{{ user `os_image` }}",
"flavor": "{{ user `os_flavor` }}",
"user_data_file": "config-drive/user-data.yaml",
"tenant_id": "{{ user `os_tenant` }}",
"networks": ["{{ user `os_network` }}"],
"availability_zone": "{{user `os_zone`}}",
"identity_endpoint": "{{user `os_endpoint`}}",
"username": "{{user `os_username`}}",
"password": "{{user `os_password`}}"
}
]
}