Major refactor of Packer Vagrant+Docker logic
[integration/packaging.git] / packer / templates / virtualbox.json
1 {
2   "variables": {
3     "odl_version": null,
4     "centos_version": null,
5     "docker_repo": null,
6     "rpm_repo_file": null,
7     "rpm_repo_url": null
8   },
9   "builders": [
10     {
11       "type": "virtualbox-iso",
12       "guest_os_type": "RedHat_64",
13       "iso_urls": "{{ user `iso_urls` }}",
14       "iso_checksum": "{{ user `iso_checksum` }}",
15       "iso_checksum_type": "sha256",
16       "headless": "false",
17       "ssh_username": "vagrant",
18       "ssh_password": "vagrant",
19       "ssh_wait_timeout": "20m",
20       "shutdown_command": "sudo shutdown -P now",
21       "http_directory": ".",
22       "boot_command": [
23         "<tab>text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/provision/centos_kickstart.cfg<enter>"
24       ],
25       "vboxmanage": [
26         [
27           "modifyvm",
28           "{{ .Name }}",
29           "--memory",
30           "1024"
31         ],
32         [
33           "modifyvm",
34           "{{ .Name }}",
35           "--cpus",
36           "2"
37         ]
38       ]
39     }
40   ],
41   "provisioners": [
42     {
43       "type": "shell",
44       "scripts":
45         [
46           "provision/config_virtualbox.sh",
47           "provision/config_vagrant.sh",
48           "provision/config_ansible.sh"
49         ]
50     },
51     {
52       "type": "ansible-local",
53       "playbook_file": "provision/install_odl.yml",
54       "extra_arguments": [
55         "--extra-vars",
56         "\"rpm_repo_file={{ user `rpm_repo_file` }}",
57         "rpm_repo_url={{ user `rpm_repo_url` }}\""
58       ]
59     }
60   ],
61   "post-processors": [
62     {
63       "type": "vagrant",
64       "compression_level": "9",
65       "output": "opendaylight-{{ user `odl_version` }}-centos-{{ user `centos_version` }}-virtualbox.box"
66     }
67   ]
68 }