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
|
{
"variables": {
"stack_tenant": "ubuntu",
"stack_user": "ubuntu",
"stack_pass": "ubuntu",
"stack_network": "none",
"base_image": null,
"cloud_user": "ubuntu",
"distro": null,
"cloud_user_data": null
},
"builders": [
{
"type": "qemu",
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.4-server-amd64.iso",
"iso_checksum": "6a7f31eb125a0b2908cf2333d7777c82",
"iso_checksum_type": "md5",
"output_directory": "output_ubuntu",
"disk_size": 20000,
"format": "qcow2",
"headless": true,
"accelerator": "kvm",
"http_directory": "httpdir",
"http_port_min": 10082,
"http_port_max": 10089,
"ssh_host_port_min": 2222,
"ssh_host_port_max": 2229,
"ssh_username": "ubuntu",
"ssh_password": "ubuntu",
"ssh_port": 22,
"ssh_wait_timeout": "11m",
"vm_name": "jenkins-new-test",
"net_device": "virtio-net",
"disk_interface": "virtio",
"boot_wait": "5s",
"boot_command": [
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"/install/vmlinuz url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname=jenkinstest ",
"keyboard-configuration/modelcode=SKIP ",
"keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA ",
"passwd/user-fullname=ubuntu ",
"passwd/user-password-again=ubuntu ",
"passwd/user-password=ubuntu ",
"passwd/username=ubuntu ",
"initrd=/install/initrd.gz -- <enter>"
]
}
],
"provisioners": [
{
"type": "shell",
"inline": ["mkdir -p /tmp/packer"]
},
{
"type": "file",
"source": "provision/basebuild/",
"destination": "/tmp/packer"
},
{
"type": "shell",
"scripts": [
"provision/baseline.sh",
"provision/basebuild.sh",
"provision/agl_dependencies.sh",
"provision/system_reseal.sh"
],
"environment_vars": [
"LAVAHOST={{user `lavahost`}}",
"LAVAUSER={{user `lavauser`}}",
"LAVATOKEN={{user `lavatoken`}}"
],
"execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else echo 'ubuntu' | {{ .Vars }} sudo -S -E sh '{{ .Path }}'; fi"
}
]
}
|