blob: 6ffd6ddca14d392f2fc9c6adf51eb94a64253a7a [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 {
azvyagintsev5a388552018-04-03 21:25:23 +030023 "type": "shell",
24 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
25 "expect_disconnect": "true",
azvyagintsev4053eb22018-03-29 16:21:51 +030026 "environment_vars": [
27 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
azvyagintsev5a388552018-04-03 21:25:23 +030028 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
29 "SALTSTACK_REPO={{ user `saltstack_repo` }}"
azvyagintsev4053eb22018-03-29 16:21:51 +030030 ],
Filip Pytloun7ae5c752016-01-15 13:48:38 +010031 "override": {
azvyagintsevd8f85232017-10-02 15:30:28 +030032 "qemu": {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010033 "scripts": [
34 "scripts/base.sh",
azvyagintsevc0d1b8a2018-03-22 19:05:03 +020035 "scripts/motd.sh",
azvyagintsevd8f85232017-10-02 15:30:28 +030036 "scripts/salt.sh",
Jakub Josef6bcf3862017-05-03 16:16:39 +020037 "scripts/network.sh",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010038 "scripts/security.sh",
39 "scripts/cleanup.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030040 "scripts/info.sh",
41 "scripts/zerodisk.sh"
Filip Pytloun7ae5c752016-01-15 13:48:38 +010042 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030043 },
azvyagintsev4053eb22018-03-29 16:21:51 +030044 "openstack": {
45 "scripts": [
46 "scripts/base.sh",
47 "scripts/motd.sh",
48 "scripts/salt.sh",
49 "scripts/network.sh",
50 "scripts/security.sh",
51 "scripts/cleanup.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030052 "scripts/info.sh",
53 "scripts/zerodisk.sh"
azvyagintsev4053eb22018-03-29 16:21:51 +030054 ]
azvyagintsevd8f85232017-10-02 15:30:28 +030055 }
Filip Pytloun7ae5c752016-01-15 13:48:38 +010056 }
57 },
58 {
59 "type": "file",
Ivan Berezovskiy9f5c7182018-09-06 13:36:25 +040060 "source": "files/etc/",
61 "destination": "/etc"
Vasyl Saienko59096f22018-11-26 17:26:42 +020062 },
63 {
64 "type": "file",
65 "source": "files/scripts/",
66 "destination": "/usr/bin"
Filip Pytloun7ae5c752016-01-15 13:48:38 +010067 }
68 ],
Filip Pytloun7ae5c752016-01-15 13:48:38 +010069 "builders": [
70 {
Filip Pytloun7ae5c752016-01-15 13:48:38 +010071 "type": "qemu",
Filip Pytloun56cf9e32016-02-19 09:56:08 +010072 "qemuargs": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020073 ["-m", "1024M"],
azvyagintsev262b28c2018-10-23 18:38:42 +030074 ["-device", "virtio-net,netdev=user.0"],
75 ["-object","rng-random,id=objrng0,filename=/dev/urandom"],
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020076 ["-device", "virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x10"]
Filip Pytloun56cf9e32016-02-19 09:56:08 +010077 ],
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +000078 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2",
79 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
80 "disk_compression": true,
81 "disk_size": "{{ user `disk_size`}}",
azvyagintsevbe158632018-12-13 20:23:52 +020082 "boot_key_interval": "50ms",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010083 "accelerator": "kvm",
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020084 "iso_checksum": "24636fd103a2a43c95659f1c3c63718e",
85 "iso_checksum_type": "md5",
86 "iso_url": "http://releases.ubuntu.com/16.04.5/ubuntu-16.04.5-server-amd64.iso",
87 "iso_target_path": "{{ user `images_cache` }}/ubuntu-16.04.5-server-amd64.iso",
88 "http_directory": "http",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010089 "headless": true,
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020090 "ssh_username": "{{user `user`}}",
91 "ssh_password": "{{user `password`}}",
92 "shutdown_command": "sync; sudo /sbin/shutdown -hP now",
Filip Pytloun7ae5c752016-01-15 13:48:38 +010093 "boot_wait": "2s",
azvyagintsevbe158632018-12-13 20:23:52 +020094 "ssh_wait_timeout": "15m",
95 "ssh_host_port_min": 7050,
96 "ssh_host_port_max": 7060,
azvyagintsev393dc8e2018-11-19 11:31:26 +020097 "boot_command": [
Vasyl Saienkoba5bc5a2018-11-22 15:02:49 +020098 "<enter><wait><f6><esc>",
99 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
100 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
101 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
102 "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
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>",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200108 "/install/vmlinuz<wait>",
109 " auto<wait>",
110 " console-setup/ask_detect=false<wait>",
111 " console-setup/layoutcode=us<wait>",
112 " console-setup/modelcode=pc105<wait>",
113 " debconf/frontend=noninteractive<wait>",
114 " debian-installer=en_US<wait>",
115 " fb=false<wait>",
116 " initrd=/install/initrd.gz<wait>",
117 " kbd-chooser/method=us<wait>",
118 " keyboard-configuration/layout=USA<wait>",
119 " keyboard-configuration/variant=USA<wait>",
azvyagintsev393dc8e2018-11-19 11:31:26 +0200120 " locale=en_US<wait>",
121 " netcfg/get_hostname=ubuntu<wait>",
122 " netcfg/get_domain=local<wait>",
123 " noapic<wait>",
124 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
125 " -- <wait>",
126 "<enter><wait>"
127 ]
azvyagintsevd8f85232017-10-02 15:30:28 +0300128 },
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100129 {
azvyagintsev4053eb22018-03-29 16:21:51 +0300130 "type": "openstack",
131 "ssh_username": "{{user `user`}}",
132 "ssh_password": "{{user `password`}}",
133 "image_name": "{{user `image_name`}}",
134 "floating_ip_pool": "{{user `os_floating_ip_pool`}}",
135 "reuse_ips": "true",
136 "source_image": "{{ user `os_image` }}",
137 "flavor": "{{ user `os_flavor` }}",
138 "user_data_file": "config-drive/user-data.yaml",
139 "tenant_id": "{{ user `os_tenant` }}",
140 "networks": ["{{ user `os_network` }}"],
141 "availability_zone": "{{user `os_zone`}}",
142 "identity_endpoint": "{{user `os_endpoint`}}",
143 "username": "{{user `os_username`}}",
144 "password": "{{user `os_password`}}"
Filip Pytloun7ae5c752016-01-15 13:48:38 +0100145 }
146 ]
alexz5b795142018-02-13 15:59:28 +0100147}