Add packer scripts for vagrant image generation
[osm/devops.git] / packer / ubuntu1604-juju.json
1 {
2   "provisioners": [
3     {
4       "type": "shell",
5       "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
6       "script": "scripts/install_packages.sh"
7     },
8     {
9       "type": "shell",
10       "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
11       "script": "scripts/setup.sh"
12     },
13     {
14         "type": "file",
15         "source": "scripts/lxd-bridge",
16         "destination": "/tmp/lxd-bridge"
17     },
18     {
19         "type": "shell",
20         "script": "scripts/lxd-setup.sh"
21     },
22     {
23         "type": "shell",
24         "script": "scripts/juju-setup.sh"
25     }
26   ],
27   "builders": [
28     {
29       "type": "virtualbox-iso",
30       "boot_command": [
31         "<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
32         "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
33         "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
34         "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
35         "/install/vmlinuz<wait>",
36         " auto<wait>",
37         " console-setup/ask_detect=false<wait>",
38         " console-setup/layoutcode=us<wait>",
39         " console-setup/modelcode=pc105<wait>",
40         " debconf/frontend=noninteractive<wait>",
41         " debian-installer=en_US<wait>",
42         " fb=false<wait>",
43         " initrd=/install/initrd.gz<wait>",
44         " kbd-chooser/method=us<wait>",
45         " keyboard-configuration/layout=USA<wait>",
46         " keyboard-configuration/variant=USA<wait>",
47         " locale=en_US<wait>",
48         " netcfg/get_domain=vm<wait>",
49         " netcfg/get_hostname=vagrant<wait>",
50         " grub-installer/bootdev=/dev/sda<wait>",
51         " noapic<wait>",
52         " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
53         " -- <wait>",
54         "<enter><wait>"
55       ],
56       "boot_wait": "10s",
57       "disk_size": 15360,
58       "guest_os_type": "Ubuntu_64",
59       "headless": true,
60       "http_directory": "http",
61       "iso_urls": [
62         "iso/ubuntu-16.04.4-server-amd64.iso",
63         "http://releases.ubuntu.com/16.04/ubuntu-16.04.4-server-amd64.iso"
64       ],
65       "iso_checksum_type": "sha256",
66       "iso_checksum": "0a03608988cfd2e50567990dc8be96fb3c501e198e2e6efcb846d89efc7b89f2",
67       "ssh_username": "vagrant",
68       "ssh_password": "vagrant",
69       "ssh_port": 22,
70       "ssh_wait_timeout": "10000s",
71       "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
72       "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
73       "virtualbox_version_file": ".vbox_version",
74       "vm_name": "packer-ubuntu-16.04-amd64-juju",
75       "vboxmanage": [
76         [
77           "modifyvm",
78           "{{.Name}}",
79           "--memory",
80           "4096"
81         ],
82         [
83           "modifyvm",
84           "{{.Name}}",
85           "--cpus",
86           "2"
87         ]
88       ]
89     }
90   ]
91 }