-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathalmalinux_kitten_10_gencloud.pkr.hcl
147 lines (141 loc) · 5.6 KB
/
almalinux_kitten_10_gencloud.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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# AlmaLinux OS Kitten 10 Packer template for Cloud-init included and OpenStack compatible Generic Cloud images
source "qemu" "almalinux_kitten_10_gencloud_x86_64" {
iso_url = var.iso_url_kitten_10_x86_64
iso_checksum = var.iso_checksum_kitten_10_x86_64
http_directory = var.http_directory
shutdown_command = var.root_shutdown_command
ssh_username = var.gencloud_ssh_username
ssh_password = var.gencloud_ssh_password
ssh_timeout = var.ssh_timeout
boot_command = var.gencloud_boot_command_kitten_10_x86_64
boot_wait = var.boot_wait
accelerator = "kvm"
disk_interface = "virtio-scsi"
disk_size = var.gencloud_disk_size
disk_cache = "unsafe"
disk_discard = "unmap"
disk_detect_zeroes = "unmap"
disk_compression = true
format = "qcow2"
headless = var.headless
machine_type = "q35"
memory = var.memory_x86_64
net_device = "virtio-net"
qemu_binary = var.qemu_binary
vm_name = "AlmaLinux-Kitten-GenericCloud-10-${formatdate("YYYYMMDD", timestamp())}.${var.build_number}.x86_64.qcow2"
cpu_model = "host"
cpus = var.cpus
efi_boot = true
efi_firmware_code = var.ovmf_code
efi_firmware_vars = var.ovmf_vars
efi_drop_efivars = true
}
source "qemu" "almalinux_kitten_10_gencloud_aarch64" {
iso_url = var.iso_url_kitten_10_aarch64
iso_checksum = var.iso_checksum_kitten_10_aarch64
http_directory = var.http_directory
shutdown_command = var.root_shutdown_command
ssh_username = var.gencloud_ssh_username
ssh_password = var.gencloud_ssh_password
ssh_timeout = var.ssh_timeout
boot_command = var.gencloud_boot_command_kitten_10_aarch64
boot_wait = var.boot_wait
accelerator = "kvm"
firmware = var.aavmf_code
use_pflash = false
disk_interface = "virtio-scsi"
disk_size = var.gencloud_disk_size
disk_cache = "unsafe"
disk_discard = "unmap"
disk_detect_zeroes = "unmap"
disk_compression = true
format = "qcow2"
headless = var.headless
machine_type = "virt,gic-version=max"
memory = var.memory_aarch64
net_device = "virtio-net"
qemu_binary = var.qemu_binary
vm_name = "AlmaLinux-Kitten-GenericCloud-10-${formatdate("YYYYMMDD", timestamp())}.${var.build_number}.aarch64.qcow2"
cpu_model = "host"
cpus = var.cpus
qemuargs = [
["-boot", "strict=on"],
["-monitor", "none"],
]
}
source "qemu" "almalinux_kitten_10_gencloud_ppc64le" {
iso_url = var.iso_url_kitten_10_ppc64le
iso_checksum = var.iso_checksum_kitten_10_ppc64le
http_directory = var.http_directory
shutdown_command = var.root_shutdown_command
ssh_username = var.gencloud_ssh_username
ssh_password = var.gencloud_ssh_password
ssh_timeout = var.ssh_timeout
boot_command = var.gencloud_boot_command_kitten_10_ppc64le
boot_wait = var.gencloud_boot_wait_ppc64le
disk_interface = "virtio-scsi"
disk_size = var.gencloud_disk_size
disk_cache = "unsafe"
disk_discard = "unmap"
disk_detect_zeroes = "unmap"
disk_compression = true
format = "qcow2"
headless = var.headless
machine_type = "pseries,accel=kvm,kvm-type=HV"
memory = var.memory_ppc64le
net_device = "virtio-net"
qemu_binary = var.qemu_binary
vm_name = "AlmaLinux-Kitten-GenericCloud-10-${formatdate("YYYYMMDD", timestamp())}.${var.build_number}.ppc64le.qcow2"
cpus = var.cpus
}
source "qemu" "almalinux_kitten_10_gencloud_x86_64_v2" {
iso_url = var.iso_url_kitten_10_x86_64_v2
iso_checksum = var.iso_checksum_kitten_10_x86_64_v2
http_directory = var.http_directory
shutdown_command = var.root_shutdown_command
ssh_username = var.gencloud_ssh_username
ssh_password = var.gencloud_ssh_password
ssh_timeout = var.ssh_timeout
boot_command = var.gencloud_boot_command_kitten_10_x86_64_v2
boot_wait = var.boot_wait
accelerator = "kvm"
disk_interface = "virtio-scsi"
disk_size = var.gencloud_disk_size
disk_cache = "unsafe"
disk_discard = "unmap"
disk_detect_zeroes = "unmap"
disk_compression = true
format = "qcow2"
headless = var.headless
machine_type = "q35"
memory = var.memory_x86_64
net_device = "virtio-net"
qemu_binary = var.qemu_binary
vm_name = "AlmaLinux-Kitten-GenericCloud-10-${formatdate("YYYYMMDD", timestamp())}.${var.build_number}.x86_64_v2.qcow2"
cpu_model = "Nehalem"
cpus = var.cpus
efi_boot = true
efi_firmware_code = var.ovmf_code
efi_firmware_vars = var.ovmf_vars
efi_drop_efivars = true
}
build {
sources = [
"source.qemu.almalinux_kitten_10_gencloud_x86_64",
"source.qemu.almalinux_kitten_10_gencloud_aarch64",
"source.qemu.almalinux_kitten_10_gencloud_ppc64le",
"source.qemu.almalinux_kitten_10_gencloud_x86_64_v2",
]
provisioner "ansible" {
galaxy_file = "./ansible/requirements.yml"
galaxy_force_install = true
collections_path = "./ansible/collections"
roles_path = "./ansible/roles"
playbook_file = "./ansible/gencloud.yml"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True",
"ANSIBLE_REMOTE_TEMP=/tmp",
"ANSIBLE_SCP_EXTRA_ARGS=-O",
]
}
}