forked from AlmaLinux/cloud-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
almalinux-9-azure.pkr.hcl
51 lines (48 loc) · 1.61 KB
/
almalinux-9-azure.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
/*
* AlmaLinux OS 9 Packer template for building an Azure image.
*/
source "qemu" "almalinux-9-azure-x86_64" {
iso_url = local.iso_url_9_x86_64
iso_checksum = local.iso_checksum_9_x86_64
shutdown_command = var.root_shutdown_command
accelerator = "kvm"
http_directory = var.http_directory
ssh_username = var.gencloud_ssh_username
ssh_password = var.gencloud_ssh_password
ssh_timeout = var.ssh_timeout
cpus = var.cpus
efi_firmware_code = var.ovmf_code
efi_firmware_vars = var.ovmf_vars
disk_interface = "virtio-scsi"
disk_size = var.azure_disk_size
disk_cache = "unsafe"
disk_discard = "unmap"
disk_detect_zeroes = "unmap"
format = "raw"
headless = var.headless
machine_type = "q35"
memory = var.memory
net_device = "virtio-net"
qemu_binary = var.qemu_binary
vm_name = "AlmaLinux-9-Azure-${var.os_ver_9}-${formatdate("YYYYMMDD", timestamp())}.x86_64.raw"
boot_wait = var.boot_wait
boot_command = local.azure_boot_command_9_x86_64
qemuargs = [
["-cpu", "host"]
]
}
build {
sources = ["qemu.almalinux-9-azure-x86_64"]
provisioner "ansible" {
galaxy_file = "./ansible/requirements.yml"
galaxy_force_install = true
collections_path = "./ansible/collections"
roles_path = "./ansible/roles"
playbook_file = "./ansible/azure.yml"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True",
"ANSIBLE_REMOTE_TEMP=/tmp",
"ANSIBLE_SCP_EXTRA_ARGS=-O"
]
}
}