-
Notifications
You must be signed in to change notification settings - Fork 1
/
packer.json
98 lines (97 loc) · 3.53 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
{
"builders": [
{
"accelerator": "kvm",
"boot_command": [
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><wait>",
"<esc><wait5><enter><wait5>",
"linux netsetup=dhcp net.ifnames=0 biosdevname=0 systemd.unified_cgroup_hierarchy=0 lang=en_US kexec=3 <wait5>",
"autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml <wait5>",
"<enter>"
],
"boot_wait": "1s",
"cpus": 2,
"disk_cache": "writeback",
"disk_compression": true,
"disk_image": false,
"disk_interface": "virtio",
"disk_size": "131072M",
"format": "qcow2",
"headless": true,
"http_directory": "./",
"iso_checksum": "53bcbcb82361c5261c9d0994ab0f94101bf28e61c06fe12d320984601be35a8f",
"iso_url": "http://downloadcontent.opensuse.org/distribution/leap/15.5/iso/openSUSE-Leap-15.5-DVD-x86_64-Build491.1-Media.iso",
"memory": 16384,
"net_device": "virtio-net",
"qemu_binary": "kvm",
"qemuargs": [
[
"-cpu",
"host"
]
],
"shutdown_command": "sudo shutdown -h now",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_read_write_timeout": "600s",
"ssh_timeout": "120m",
"ssh_username": "vagrant",
"type": "qemu",
"vnc_bind_address": "0.0.0.0",
"vnc_port_max": 6000,
"vnc_port_min": 5900
}
],
"post-processors": [
{
"inline": [
"set -eu",
"export _IMAGE=\"output-qemu/packer-qemu\"",
"sudo qemu-img convert -f qcow2 -O qcow2 \"$_IMAGE\" \"$_IMAGE.convert\"",
"sudo rm -rf \"$_IMAGE\"",
"sudo chmod a+r /boot/vmlinuz*",
"sudo virt-customize --no-network -a \"$_IMAGE.convert\" --delete \"/var/lib/*/random-seed\" --delete \"/var/lib/wicked/*\" --firstboot-command \"/usr/local/bin/virt-sysprep-firstboot.sh\"",
"sudo virt-sysprep --operations defaults,-ssh-userdir,-customize -a \"$_IMAGE.convert\"",
"sudo virt-sparsify --in-place \"$_IMAGE.convert\"",
"sudo qemu-img convert -f qcow2 -O qcow2 -c \"$_IMAGE.convert\" \"$_IMAGE\"",
"sudo rm -rf \"$_IMAGE.convert\""
],
"type": "shell-local"
},
{
"compression_level": 9,
"keep_input_artifact": true,
"output": "output-vagrant/package.box",
"provider_override": "libvirt",
"type": "vagrant"
}
],
"provisioners": [
{
"inline": [
"set -eu",
"sudo zypper -n --gpg-auto-import-keys refresh",
"sudo zypper -n dist-upgrade -y --allow-vendor-change",
"sudo zypper -n install -y ca-certificates curl gcc glibc-i18ndata glibc-locale hostname iproute2 python3 sudo",
"sudo zypper -n install -y qemu-guest-agent"
],
"type": "shell"
},
{
"galaxy_file": "./ansible-galaxy-requirements.yml",
"inventory_directory": "./",
"playbook_file": "./packer.yml",
"type": "ansible",
"user": "vagrant"
}
]
}