Merge "Add support for vim emu installation"
[osm/devops.git] / packer / ubuntu1604-ovf-osm.json
1 {
2   "provisioners": [
3     {
4       "type": "shell",
5       "script": "scripts/get-install-osm.sh",
6       "execute_command": "{{.Path}} {{user `osm_install_options`}}"
7     },
8     {
9       "type": "shell",
10       "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
11       "script": "scripts/vimemu.sh"
12     },
13     {
14       "type": "shell",
15       "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
16       "script": "scripts/cleanup.sh"
17     }
18   ],
19   "variables": {
20     "osm_install_options": "--vimemu",
21     "input_ovf": "output-virtualbox-iso/packer-ubuntu-16.04-amd64-juju.ovf",
22     "vm_name": "xenial-osm"
23   },
24   "builders": [
25     {
26       "type": "virtualbox-ovf",
27       "source_path": "{{user `input_ovf`}}",
28       "headless": true,
29       "ssh_username": "vagrant",
30       "ssh_password": "vagrant",
31       "ssh_port": 22,
32       "ssh_wait_timeout": "10000s",
33       "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
34       "virtualbox_version_file": ".vbox_version",
35       "vm_name": "{{user `vm_name`}}",
36       "output_directory": "osm-{{timestamp}}",
37       "vboxmanage": [
38         [
39           "modifyvm",
40           "{{.Name}}",
41           "--memory",
42           "4096"
43         ],
44         [
45           "modifyvm",
46           "{{.Name}}",
47           "--cpus",
48           "2"
49         ]
50       ]
51     }
52   ],
53   "post-processors": [
54     [
55       {
56         "output": "osm-{{timestamp}}/{{.Provider}}-osm.box",
57         "type": "vagrant",
58         "keep_input_artifact": true
59       },
60       {
61         "type": "vagrant-cloud",
62         "box_tag": "osm/{{user `release`}}",
63         "access_token": "{{user `cloud_token`}}",
64         "version": "{{user `version`}}"
65       }
66     ]
67   ]
68 }