Minimize docker image and vagrant box sizes
[integration/packaging.git] / packer / templates / libvirt.json
1 {
2     "variables": {
3         "odl_version": null,
4         "os_name": null,
5         "os_version": null,
6         "iso_urls": null,
7         "iso_checksum": null,
8         "rpm_repo_file": null,
9         "rpm_repo_url": null
10     },
11     "builders": [
12         {
13             "type": "qemu",
14             "iso_urls": "{{ user `iso_urls` }}",
15             "iso_checksum": "{{ user `iso_checksum` }}",
16             "iso_checksum_type": "sha256",
17             "ssh_username": "vagrant",
18             "ssh_password": "vagrant",
19             "ssh_wait_timeout": "60m",
20             "shutdown_command": "sudo shutdown -P now",
21             "http_directory": ".",
22             "boot_command": [
23                 "<tab>text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/provision/{{ user `os_name` }}_kickstart.cfg<enter>"
24             ]
25         }
26     ],
27     "provisioners": [
28         {
29             "type": "shell",
30             "scripts": [
31                 "provision/config_vagrant.sh",
32                 "provision/config_ansible_{{ user `os_name`}}.sh",
33                 "provision/config_ssh.sh",
34                 "provision/cleanup_{{ user `os_name`}}.sh",
35                 "provision/minimize.sh"
36             ]
37         },
38         {
39             "type": "ansible-local",
40             "playbook_file": "provision/install_odl.yml",
41             "extra_arguments": [
42                 "--extra-vars",
43                 "\"rpm_repo_file={{ user `rpm_repo_file` }}",
44                 "rpm_repo_url={{ user `rpm_repo_url` }}\""
45             ]
46         }
47     ],
48     "post-processors": [
49         {
50             "type": "vagrant",
51             "compression_level": "9",
52             "output": "opendaylight-{{ user `odl_version` }}-{{ user `os_name` }}-{{ user `os_version` }}-libvirt.box"
53         }
54     ]
55 }