-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot.json.j2
More file actions
90 lines (90 loc) · 3.29 KB
/
root.json.j2
File metadata and controls
90 lines (90 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
"builders": [
{
"boot_command": [
{%- for command in boot_command %}
"{$ command $}"{%- if not loop.last -%},{%- endif -%}
{%- endfor %}
],
"boot_wait": "{$ boot_wait $}",
"cpus": {$ cpus $},
"disk_size": {$ disk_size $},
"export_opts": [
"--ovf10",
"--manifest",
"--options", "manifest,nomacsbutnat",
"--vsys", "0",
"--description", "{{ build_name }}",
"--product", "{{ build_name }}",
"--version", "{{ user `build_timestamp` }}",
"--vmname", "{{ build_name }}"
],
"format": "ova",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "{$ guest_os_type $}",
"hard_drive_interface": "sata",
"headless": {$ 'true' if headless else 'false' $},
"http_directory": "{$ paths.build_dir $}",
"iso_checksum": "{$ iso_checksum $}",
"iso_url": "{$ iso_url $}",
"keep_registered": true,
"memory": {$ build_memory $},
"name": "{{ user `name` }}",
"output_directory": "{$ paths.output_dir $}/{{ build_name }}-{{ user `build_timestamp` }}",
"output_filename": "{{ build_name }}",
"shutdown_command": "echo '{$ pass $}' | sudo -S /sbin/shutdown -P now",
"skip_export": true,
"ssh_handshake_attempts": {$ ssh_handshake_attempts $},
"ssh_password": "{$ pass $}",
"ssh_timeout": "10000s",
"ssh_username": "{$ user $}",
"type": "virtualbox-iso",
"vboxmanage": [
["modifyvm", "{{ .Name }}", "--graphicscontroller", "{$ graphicscontroller $}"],
["modifyvm", "{{ .Name }}", "--vram", {$ vram $}],
["modifyvm", "{{ .Name }}", "--pae", "off"]
],
"vboxmanage_post": [
["modifyvm", "{{ .Name }}", "--memory", {$ memory $}],
["modifyvm", "{{ .Name }}", "--vrde", "off"],
["storageattach", "{{ .Name }}", "--storagectl", "IDE Controller", "--port", 0, "--device", 1, "--type", "dvddrive", "--medium", "emptydrive"],
["snapshot", "{{ .Name }}", "take", "Root"]
],
"vm_name": "packer-{% if vagrant %}vagrant-{% endif %}{$ args.distro $}-{$ args.release $}-{$ variant $}"
}
],
"provisioners": [
{
"environment_vars": [
{% if keep_x -%}
"KEEP_X=yes",
{% endif -%}
"HOME_DIR=/home/{$ user $}",
"ADMIN_USER={$ user $}",
"ADMIN_PASS={$ pass $}",
"FILE_SERVER_URL={$ services.file_server_url $}"
],
"execute_command": "echo '{$ pass $}' | {{ .Vars }} sudo -S -E sh -eux '{{ .Path }}'",
"expect_disconnect": true,
"scripts": [
{%- for script in scripts_before %}
"{$ paths.scripts_dir $}/{$ script $}.sh",
{%- endfor %}
{%- for script in scripts %}
"{$ paths.scripts_dir $}/{$ script $}.sh",
{%- endfor %}
{%- if vagrant %}
"{$ paths.scripts_dir $}/vagrant.sh",
"{$ paths.scripts_dir $}/vagrant_sudoers.sh"{%- if scripts_after -%},{%- endif -%}
{%- endif %}
{%- for script in scripts_after %}
"{$ paths.scripts_dir $}/{$ script $}.sh"{%- if not loop.last -%},{%- endif -%}
{%- endfor %}
],
"type": "shell"
}
],
"variables": {
"build_timestamp": "{{ isotime \"2006-01-02-15-04-05\" }}"
}
}