-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchild.json.j2
More file actions
81 lines (81 loc) · 2.8 KB
/
child.json.j2
File metadata and controls
81 lines (81 loc) · 2.8 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
{
"builders": [
{
"attach_snapshot": "Root",
"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_mode": "disable",
"headless": {$ 'true' if headless else 'false' $},
"keep_registered": false,
"name": "{{ user `name` }}",
"output_directory": "{$ paths.ova_output_dir $}/{{ build_name }}-{{ user `build_timestamp` }}",
"output_filename": "{{ build_name }}",
"shutdown_command": "echo '{$ pass $}' | sudo -S /sbin/shutdown -P now",
"ssh_password": "{$ pass $}",
"ssh_timeout": "10000s",
"ssh_username": "{$ user $}",
"target_snapshot": "{{ build_name }}-{{ user `build_timestamp` }}",
"type": "virtualbox-vm",
"vboxmanage": [
["modifyvm", "{{ .Name }}", "--graphicscontroller", "{$ graphicscontroller $}"],
["modifyvm", "{{ .Name }}", "--memory", {$ build_memory $}],
["modifyvm", "{{ .Name }}", "--vram", {$ vram $}],
["modifyvm", "{{ .Name }}", "--clipboard-mode", "{$ clipboardmode $}"],
["modifyvm", "{{ .Name }}", "--draganddrop", "{$ draganddrop $}"]
],
"vboxmanage_post": [
["modifyvm", "{{ .Name }}", "--memory", {$ memory $}],
["modifyvm", "{{ .Name }}", "--vrde", "off"]
],
"vm_name": "packer-{% if vagrant %}vagrant-{% endif %}{$ args.distro $}-{$ args.release $}-root"
}
],
"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 %}
{%- for script in scripts_after %}
"{$ paths.scripts_dir $}/{$ script $}.sh"{% if not loop.last %},{% endif %}
{%- endfor %}
],
"type": "shell"
}
],
"post-processors": [
{% if vagrant -%}
{
"output": "{$ paths.box_output_dir $}/{{ build_name }}-{{ user `build_timestamp` }}/{{ build_name }}.box",
"type": "vagrant",
"keep_input_artifact": false
}
{% endif -%}
],
"variables": {
"build_timestamp": "{{ isotime \"2006-01-02-15-04-05\" }}"
}
}