blob: 076fdec1ab2d9fb54c9a14106f3bb0840c1f2ad4 [file] [log] [blame]
Filip Pytloun7ae5c752016-01-15 13:48:38 +01001{
azvyagintsevd8f85232017-10-02 15:30:28 +03002 "variables": {
3 "user": "root",
azvyagintsevbe158632018-12-13 20:23:52 +02004 "password": "r00tme",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +02005 "disk_size": "5000",
azvyagintsev0f697cf2018-06-22 11:44:13 +03006 "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
azvyagintsev8d938882018-08-29 12:36:36 +03007 "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
Jiri Broulik2ad150e2018-04-19 17:48:55 +02008 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
9 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030010 "do_api_token": "{{ env `DO_API_TOKEN` }}",
Jiri Broulik0b211672018-04-11 09:35:47 +020011 "image_name": "{{ env `IMAGE_NAME` }}",
azvyagintsev4053eb22018-03-29 16:21:51 +030012 "os_username": "{{ env `OS_USERNAME` }}",
13 "os_password": "{{ env `OS_PASSWORD` }}",
14 "os_image": "7451fac0-0ce5-4d30-ae36-cd9a90e7948e",
15 "os_endpoint": "https://cloud-cz.bud.mirantis.net:5000/v2.0",
16 "os_zone": "mcp-mk",
17 "os_floating_ip_pool": "public",
18 "os_tenant": "26e4dd19485249608ee3685f254f3909",
19 "os_network": "772f8ca6-1f4a-4535-99d0-880d6ead9a82"
azvyagintsevd8f85232017-10-02 15:30:28 +030020 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +010021 "provisioners": [
22 {
azvyagintsev9a1737f2019-03-11 15:44:54 +020023 "type": "shell-local",
24 "command": "cp -av ../common/files/scripts/growlvm.py files/scripts/growlvm.py"
25 },
26 {
azvyagintsev5a388552018-04-03 21:25:23 +030027 "type": "shell",
28 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
29 "expect_disconnect": "true",
azvyagintsev4053eb22018-03-29 16:21:51 +030030 "environment_vars": [
31 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
azvyagintsev5a388552018-04-03 21:25:23 +030032 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
33 "SALTSTACK_REPO={{ user `saltstack_repo` }}"
azvyagintsev4053eb22018-03-29 16:21:51 +030034 ],
Filip Pytloun7ae5c752016-01-15 13:48:38 +010035 "override": {
azvyagintsevd8f85232017-10-02 15:30:28 +030036 "qemu": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010037 "scripts": [
38 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020039 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030040 "scripts/salt.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020041 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010042 "scripts/security.sh",
43 "scripts/cleanup.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030044 "scripts/info.sh",
45 "scripts/zerodisk.sh"
Filip Pytloun7ae5c752016-01-15 13:48:38 +010046 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030047 },
azvyagintsev4053eb22018-03-29 16:21:51 +030048 "openstack": {
49 "scripts": [
50 "scripts/base.sh",
51 "scripts/motd.sh",
52 "scripts/salt.sh",
53 "scripts/network.sh",
54 "scripts/security.sh",
55 "scripts/cleanup.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030056 "scripts/info.sh",
57 "scripts/zerodisk.sh"
azvyagintsev4053eb22018-03-29 16:21:51 +030058 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030059 }
Filip Pytloun7ae5c752016-01-15 13:48:38 +010060 }
61 },
62 {
63 "type": "file",
Ivan Berezovskiy9f5c7182018-09-06 13:36:25 +040064 "source": "files/etc/",
65 "destination": "/etc"
Vasyl Saienko59096f22018-11-26 17:26:42 +020066 },
67 {
68 "type": "file",
69 "source": "files/scripts/",
70 "destination": "/usr/bin"
Filip Pytloun7ae5c752016-01-15 13:48:38 +010071 }
72 ],
Filip Pytloun7ae5c752016-01-15 13:48:38 +010073 "builders": [
74 {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010075 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +010076 "qemuargs": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020077 ["-m", "1024M"],
azvyagintsev262b28c2018-10-23 18:38:42 +030078 ["-device", "virtio-net,netdev=user.0"],
79 ["-object","rng-random,id=objrng0,filename=/dev/urandom"],
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020080 ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10"]
Filip Pytloun56cf9e32016-02-19 09:56:08 +010081 ],
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +000082 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2",
83 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
84 "disk_compression": true,
85 "disk_size": "{{ user `disk_size`}}",
azvyagintsevbe158632018-12-13 20:23:52 +020086 "boot_key_interval": "50ms",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010087 "accelerator": "kvm",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020088 "iso_checksum": "24636fd103a2a43c95659f1c3c63718e",
89 "iso_checksum_type": "md5",
90 "iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso",
91 "iso_target_path": "{{ user `images_cache` }}/ubuntu-16.04.5-server-amd64.iso",
92 "http_directory": "http",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010093 "headless": true,
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020094 "ssh_username": "{{user `user`}}",
95 "ssh_password": "{{user `password`}}",
96 "shutdown_command": "sync; sudo /sbin/shutdown -hP now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010097 "boot_wait": "2s",
azvyagintsevbe158632018-12-13 20:23:52 +020098 "ssh_wait_timeout": "15m",
99 "ssh_host_port_min": 7050,
100 "ssh_host_port_max": 7060,
azvyagintsev393dc8e2018-11-19 11:31:26 +0200101 "boot_command": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +0200102 "<enter><wait><f6><esc>",
103 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
104 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
105 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
106 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
107 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
108 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
109 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
110 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
111 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200112 "/install/vmlinuz<wait>",
113 " auto<wait>",
114 " console-setup/ask_detect=false<wait>",
115 " console-setup/layoutcode=us<wait>",
116 " console-setup/modelcode=pc105<wait>",
117 " debconf/frontend=noninteractive<wait>",
118 " debian-installer=en_US<wait>",
119 " fb=false<wait>",
120 " initrd=/install/initrd.gz<wait>",
121 " kbd-chooser/method=us<wait>",
122 " keyboard-configuration/layout=USA<wait>",
123 " keyboard-configuration/variant=USA<wait>",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200124 " locale=en_US<wait>",
125 " netcfg/get_hostname=ubuntu<wait>",
126 " netcfg/get_domain=local<wait>",
127 " noapic<wait>",
128 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
129 " -- <wait>",
130 "<enter><wait>"
131 ]
azvyagintsevd8f85232017-10-02 15:30:28 +0300132 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100133 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300134 "type": "openstack",
135 "ssh_username": "{{user `user`}}",
136 "ssh_password": "{{user `password`}}",
137 "image_name": "{{user `image_name`}}",
138 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
139 "reuse_ips": "true",
140 "source_image": "{{ user `os_image` }}",
141 "flavor": "{{ user `os_flavor` }}",
142 "user_data_file": "config-drive/user-data.yaml",
143 "tenant_id": "{{ user `os_tenant` }}",
144 "networks": ["{{ user `os_network` }}"],
145 "availability_zone": "{{user `os_zone`}}",
146 "identity_endpoint": "{{user `os_endpoint`}}",
147 "username": "{{user `os_username`}}",
148 "password": "{{user `os_password`}}"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100149 }
150 ]
alexz5b795142018-02-13 15:59:28 +0100151}