-
Notifications
You must be signed in to change notification settings - Fork 3
/
debian-arm64.json
130 lines (130 loc) · 5.49 KB
/
debian-arm64.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{
"variables": {
"vm_name": "debian-arm64",
"iso_url": "http://ftp.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/mini.iso",
"iso_checksum": "file:http://ftp.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/SHA256SUMS",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_timeout": "6h",
"output_directory": "./output-qemu",
"disk_size": "8G",
"local_cache": "false",
"ansible_version": "2.10.7",
"rpi_firmware_version": "1.20200601",
"rpi_hardware_version": "4",
"extra_env_vars": "",
"extra_ansible_vars": "",
"extra_boot_args": "mirror/http/proxy="
},
"builders": [
{
"type": "qemu",
"accelerator": "kvm",
"machine_type": "virt",
"memory": 2048,
"cpus": 2,
"net_device": "virtio-net",
"use_default_display": true,
"vm_name": "{{ user `vm_name` }}",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"ssh_username": "{{ user `ssh_username` }}",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_timeout": "{{ user `ssh_timeout` }}",
"disk_size": "{{ user `disk_size` }}",
"disk_detect_zeroes": "on",
"disk_interface": "virtio-scsi",
"format": "raw",
"output_directory": "{{ user `output_directory` }}",
"qemu_binary": "qemu-system-aarch64",
"qemuargs": [
[ "-bios", "/usr/share/qemu-efi-aarch64/QEMU_EFI.fd" ],
[ "-machine", "virt,gic-version=3" ],
[ "-cpu", "cortex-a53" ],
[ "-monitor", "none" ],
[ "-boot", "strict=off" ]
],
"headless": true,
"http_directory": "http",
"boot_command": [
"c<wait>",
"linux /linux ",
"locale=en_US.UTF-8 ",
"keyboard-configuration/xkb-keymap=us ",
"debconf/frontend=noninteractive ",
"netcfg/get_hostname=unassigned-hostname ",
"netcfg/get_domain=unassigned-domain ",
"passwd/username={{ user `ssh_username` }} ",
"passwd/user-fullname={{ user `ssh_username` }} ",
"passwd/user-password={{ user `ssh_password` }} ",
"passwd/user-password-again={{ user `ssh_password` }} ",
"no_proxy={{ .HTTPIP }} ",
"{{ user `extra_boot_args` }} ",
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait> ",
"auto ",
"---",
"<enter><wait>",
"initrd /initrd.gz",
"<enter><wait>",
"boot<enter><wait>"
],
"shutdown_command": "sudo shutdown"
}
],
"provisioners": [
{
"type": "shell-local",
"script": "scripts/sync-cache.sh",
"execute_command": ["/bin/sh", "-c", "if [ '{{user `local_cache`}}' = true ]; then {{.Vars}} {{.Script}} load {{ user `ssh_username` }} {{ user `ssh_password` }}; else echo Skipping priming cached files; fi"]
},
{
"type": "shell",
"execute_command": "sudo {{ .Vars }} sh {{.Path}}",
"environment_vars": "{{ user `extra_env_vars` }}",
"script": "scripts/fixup-iptables.sh"
},
{
"type": "shell",
"execute_command": "if [ -n '{{user `rpi_firmware_version`}}' ]; then sudo {{ .Vars }} sh {{.Path}} {{user `rpi_firmware_version`}}; else echo Skipping firmware installation; fi",
"environment_vars": "{{ user `extra_env_vars` }}",
"script": "scripts/raspi-firmware.sh"
},
{
"type": "shell",
"execute_command": "if [ '{{user `rpi_hardware_version`}}' == 3 ]; then sudo {{ .Vars }} sh {{.Path}}; fi",
"environment_vars": "{{ user `extra_env_vars` }}",
"script": "scripts/fixup-initrd.sh"
},
{
"type": "shell",
"pause_after": "5m",
"inline": ["sudo shutdown --reboot"],
"expect_disconnect": true
},
{
"type": "shell",
"execute_command": "sudo {{ .Vars }} sh {{.Path}} {{ user `ansible_version` }}",
"environment_vars": "{{ user `extra_env_vars` }}",
"script": "scripts/install-ansible.sh"
},
{
"type": "ansible-local",
"playbook_file": "./local.yaml",
"galaxy_file": "./requirements.yaml",
"inventory_groups": "docker_hosts,k8s_hosts",
"group_vars": "./group_vars",
"command": "sudo ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook -vv",
"extra_arguments": ["--extra-vars", "\"ansible_python_interpreter=python3 {{ user `extra_ansible_vars` }}\""]
},
{
"type": "shell-local",
"script": "scripts/sync-cache.sh",
"execute_command": ["/bin/sh", "-c", "if [ '{{user `local_cache`}}' = true ]; then {{.Vars}} {{.Script}} save {{ user `ssh_username` }} {{ user `ssh_password` }}; else echo Skipping saving cached files; fi"]
},
{
"type": "shell",
"execute_command": "sudo {{ .Vars }} sh {{.Path}}",
"script": "scripts/cleanup.debian.sh"
}
]
}