-
Notifications
You must be signed in to change notification settings - Fork 0
/
rhel9.pkr.hcl
49 lines (42 loc) · 1.34 KB
/
rhel9.pkr.hcl
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
source "qemu" "rhel9" {
iso_url = "https://s3.fsrv.services/manual-file-share/rhel-9.2-x86_64-dvd.iso"
iso_checksum = "md5:90cf58ff7a8f6ef8cb20b8ff091e84b7"
headless = var.headless
accelerator = var.accelerator
output_directory = "output"
shutdown_command = "echo 'packer' | sudo -S shutdown -P now"
disk_size = "5000M"
format = "qcow2"
http_directory = "http"
ssh_username = "root"
ssh_password = "packer"
ssh_timeout = "120m"
vm_name = "rhel-9"
net_device = "virtio-net"
disk_interface = "virtio"
boot_wait = "20s"
machine_type = "q35"
boot_command = ["<up><tab> inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel9-ks.cfg<enter><wait>"]
qemuargs = [["-cpu", "host"], ["-smp", "6"], ["-m", "8192M"]]
}
variable "headless" {
type = bool
default = false
}
variable "accelerator" {
type = string
default = "kvm"
}
build {
sources = ["source.qemu.rhel9"]
provisioner "shell" {
scripts = [
"scripts/prepare.sh",
"scripts/cleanup.sh"
]
}
post-processor "shell-local" {
name = "tarball"
inline = ["/usr/bin/guestfish -a output/rhel-9 --ro -i tar-out / output/rhel-9-amd64-server.tar.gz compress:gzip numericowner:true xattrs:true selinux:true acls:true"]
}
}