forked from lamoni/junos-space-packer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspace-packer.json
77 lines (77 loc) · 3.43 KB
/
space-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
{
"builders": [
{
"type": "virtualbox-ovf",
"communicator": "ssh",
"source_path": "http/space.ova",
"ssh_skip_nat_mapping": true,
"ssh_username": "admin",
"ssh_password": "{{user `admin_password`}}",
"ssh_wait_timeout": "20m",
"ssh_host": "{{user `ip_vip`}}",
"ssh_pty": true,
"ssh_disable_agent": true,
"format": "ova",
"guest_additions_mode": "disable",
"shutdown_command": "/bin/true",
"shutdown_timeout": "9900m",
"vm_name": "space-virtualbox",
"output_directory": "space-virtualbox",
"http_directory" : "http",
"http_port_min" : 9001,
"http_port_max" : 9001,
"boot_wait": "30s",
"boot_command": [
"admin<enter><wait>",
"abc123<enter><wait>",
"abc123<enter><wait>",
"{{user `admin_password`}}<enter><wait>",
"{{user `admin_password`}}<enter><wait>",
"{{user `admin_password`}}<enter><wait10>",
"<enter><wait>",
"1<wait>",
"{{user `ip_vip`}}<enter><wait>",
"{{user `ip_subnet_mask`}}<enter><wait>",
"{{user `ip_default_gateway`}}<enter><wait>",
"{{user `ip_dns_server`}}<enter><wait>",
"N<wait>",
"N<wait>",
"1<wait>",
"{{user `ip_web_gui`}}<enter><wait>",
"N<wait>",
"N<wait>",
"{{user `hostname`}}<enter><wait>",
"{{user `maintenance_password`}}<enter><wait>",
"{{user `maintenance_password`}}<enter><wait>",
"A<wait10><wait10><wait10><wait10><wait10><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"5<wait><wait>1<wait><wait>",
"{{user `admin_password`}}<enter><wait10>",
"7<wait>",
"{{user `admin_password`}}<enter><wait><wait><wait>",
"curl -O http://{{user `local_ip`}}:{{ .HTTPPort }}/jsnap.rpm<enter><wait10>",
"yum install localinstall --nogpgcheck jsnap.rpm<enter><wait><wait><wait><wait>Y<enter><wait10>",
"curl -O http://{{user `local_ip`}}:{{ .HTTPPort }}/servicenow.img<enter><wait10><wait10>",
"tail -n +4 servicenow.img > servicenow.tgz<enter><wait10>",
"tar -xvzf servicenow.tgz<enter><wait10>",
"cd Service-Now*<enter><wait>",
"STATUS=`curl -sS https://{{user `ip_web_gui`}}/mainui/ --insecure`; while true; ",
"do if [[ $STATUS != *\"loginuserpwd\"* ]]; then echo \"Waiting for Space to finish initializing\"",
" && sleep 10s && STATUS=`curl -sS https://{{user `ip_web_gui`}}/mainui/ --insecure`; ",
"else sleep 20s; curl -O http://{{user `local_ip`}}:{{ .HTTPPort }}/upload_jsnap_op_scripts.py && ",
"python upload_jsnap_op_scripts.py {{user `ip_web_gui`}} `printf 'super:juniper123' | base64` && ",
"perl installScript.pl add platform `pwd` `pwd` blah 15.2R2.4 && sleep 30s && echo '{{user `admin_password`}}' | sudo -ES /bin/bash -c ",
"'service all && service jmp-watchdog stop && service jboss stop ",
"&& service jboss-dc stop && service mysql stop && service snmpd stop ",
"&& shutdown -h +3 && echo 'Powering down in 3 minutes' && sleep 3m && poweroff'; break; fi done<enter>"
],
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "10024"],
["modifyvm", "{{.Name}}", "--cpus", "4"],
["modifyvm", "{{.Name}}", "--acpi", "on"]
]
}
]
}