-
Notifications
You must be signed in to change notification settings - Fork 25
/
packer.json
111 lines (111 loc) · 4.06 KB
/
packer.json
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
"variables": {
"ansible_common_vars": "",
"ansible_extra_vars": "dataplane_api_url={{user `dataplane_api_url`}} haproxy_rpm_url={{user `haproxy_rpm_url`}} ovf_rpctool_url={{user `ovf_rpctool_url`}}",
"build_name": "haproxy",
"build_timestamp": "{{timestamp}}",
"build_version": "{{user `build_name`}}-{{user `version`}}",
"version": "",
"dataplane_api_url": "https://storage.googleapis.com/load-balancer-api/dataplaneapi/v2.1.0/dataplaneapi",
"disable_public_repos": "false",
"disk_type_id": "0",
"distro_name": "photon",
"existing_ansible_ssh_args": "{{env `ANSIBLE_SSH_ARGS`}}",
"extra_repos": "",
"extra_rpms": "",
"guest_os_type": "vmware-photon-64",
"haproxy_rpm_url": "https://storage.googleapis.com/load-balancer-api/haproxy/v2.2.2/haproxy-2.2.2-1.ph3.x86_64.rpm",
"headless": "true",
"iso_url": "https://packages.vmware.com/photon/3.0/Rev2/iso/Update2/photon-minimal-3.0-a0f216d.iso",
"iso_checksum": "sha1:a5acf94d564f63a174a9de200e04ab6cfe2451f2",
"os_display_name": "VMware Photon OS 64-bit",
"output_directory": "./output/ova",
"reenable_public_repos": "true",
"remove_extra_repos": "false",
"ovf_rpctool_url": "https://storage.googleapis.com/load-balancer-api/ovf-rpctool/v0.0.1/ovf-rpctool",
"shutdown_command": "shutdown now",
"skip_compaction": "false",
"ssh_username": "builder",
"ssh_password": "builder",
"vmx_version": "13",
"vnc_bind_address": "127.0.0.1",
"vnc_disable_password": "false",
"vnc_port_min": "5900",
"vnc_port_max": "6000"
},
"builders": [
{
"name": "haproxy",
"vm_name": "haproxy",
"vmdk_name": "haproxy",
"output_directory": "{{user `output_directory`}}",
"type": "vmware-iso",
"version": "{{user `vmx_version`}}",
"cpus": 1,
"cores": 1,
"memory": 2048,
"disk_size": 20480,
"disk_type_id": "0",
"boot_wait": "5s",
"http_directory": "{{pwd}}",
"guest_os_type": "{{user `guest_os_type`}}",
"headless": "{{user `headless`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}",
"ssh_wait_timeout": "60m",
"boot_command": [
"<esc><wait>",
"vmlinuz initrd=initrd.img root=/dev/ram0 loglevel=3 ",
"ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/kickstart.json ",
"photon.media=cdrom<enter>"
],
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'usermod -L {{user `ssh_username`}} && {{user `shutdown_command`}}'",
"skip_compaction": "{{user `skip_compaction`}}",
"vnc_bind_address": "{{user `vnc_bind_address`}}",
"vnc_port_min": "{{user `vnc_port_min`}}",
"vnc_port_max": "{{user `vnc_port_max`}}",
"vnc_disable_password": "{{user `vnc_disable_password`}}"
}
],
"provisioners": [
{
"type": "ansible",
"playbook_file": "./ansible/playbook.yml",
"ansible_env_vars": [
"ANSIBLE_SSH_ARGS='{{user `existing_ansible_ssh_args`}} -o IdentitiesOnly=yes'",
"ANSIBLE_REMOTE_TEMP='/tmp/.ansible/'"
],
"extra_arguments": [
"--extra-vars",
"{{user `ansible_common_vars`}}",
"--extra-vars",
"{{user `ansible_extra_vars`}}"
]
}
],
"post-processors": [
{
"type": "manifest",
"output": "{{user `output_directory`}}/packer-manifest.json",
"strip_path": true,
"custom_data": {
"build_timestamp": "{{user `build_timestamp`}}",
"build_date": "{{isotime}}",
"version": "{{user `version`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}"
}
},
{
"type": "shell-local",
"command": "./hack/image-build-ova.py --vmx {{user `vmx_version`}} {{user `output_directory`}}"
},
{
"type": "shell-local",
"command": "./hack/image-post-create-config.sh {{user `output_directory`}}"
}
]
}