Feature 8839: Modified Installation script to install OSM with
[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     "build_dir": "osm-{{timestamp}}"
24   },
25   "builders": [
26     {
27       "type": "virtualbox-ovf",
28       "source_path": "{{user `input_ovf`}}",
29       "headless": true,
30       "ssh_username": "vagrant",
31       "ssh_password": "vagrant",
32       "ssh_port": 22,
33       "ssh_wait_timeout": "10000s",
34       "shutdown_command": "echo '/sbin/shutdown -h -P now' > /tmp/shutdown.sh; echo 'vagrant'|sudo -S sh '/tmp/shutdown.sh'",
35       "virtualbox_version_file": ".vbox_version",
36       "vm_name": "{{user `vm_name`}}",
37       "output_directory": "{{user `build_dir`}}",
38       "vboxmanage": [
39         [
40           "modifyvm",
41           "{{.Name}}",
42           "--memory",
43           "4096"
44         ],
45         [
46           "modifyvm",
47           "{{.Name}}",
48           "--cpus",
49           "2"
50         ]
51       ]
52     }
53   ],
54   "post-processors": [
55     [
56       {
57         "output": "{{user `build_dir`}}/{{.Provider}}-osm.box",
58         "type": "vagrant",
59         "keep_input_artifact": true
60       },
61       {
62         "type": "vagrant-cloud",
63         "box_tag": "osm/{{user `release`}}",
64         "access_token": "{{user `cloud_token`}}",
65         "version": "{{user `version`}}"
66       }
67     ]
68   ]
69 }