forked from AlmaLinux/cloud-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
almalinux-9-ami.pkr.hcl
99 lines (90 loc) · 2.77 KB
/
almalinux-9-ami.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
/*
* AlmaLinux OS 9 Packer template for building Amazon Machine Images (AMI).
*/
source "amazon-ebssurrogate" "almalinux-9-ami-x86_64" {
region = "us-east-1"
ssh_username = "ec2-user"
instance_type = "t3.small"
source_ami = "ami-0d824d9c499f27c8a"
ami_name = var.aws_ami_name_x86_64_9
ami_description = var.aws_ami_description_x86_64_9
ami_architecture = "x86_64"
ami_virtualization_type = "hvm"
ami_regions = ["us-east-1"]
tags = {
Name = "${var.aws_ami_name_x86_64_9}",
Version = "${var.aws_ami_version_9}",
Architecture = "x86_64"
}
ena_support = true
sriov_support = true
launch_block_device_mappings {
device_name = "/dev/sdb"
volume_size = 4
volume_type = "gp2"
delete_on_termination = true
}
ami_root_device {
source_device_name = "/dev/sdb"
device_name = "/dev/sda1"
volume_size = 10
volume_type = "gp2"
delete_on_termination = true
}
}
source "amazon-ebssurrogate" "almalinux-9-ami-aarch64" {
region = "us-east-1"
ssh_username = "ec2-user"
instance_type = "t4g.small"
source_ami = "ami-007e46b7d6360c103"
ami_name = var.aws_ami_name_aarch64_9
ami_description = var.aws_ami_description_aarch64_9
ami_architecture = "arm64"
ami_virtualization_type = "hvm"
ami_regions = ["us-east-1"]
tags = {
Name = "${var.aws_ami_name_aarch64_9}",
Version = "${var.aws_ami_version_9}",
Architecture = "aarch64"
}
ena_support = true
sriov_support = true
launch_block_device_mappings {
device_name = "/dev/sdb"
volume_size = 4
volume_type = "gp2"
delete_on_termination = true
}
ami_root_device {
source_device_name = "/dev/sdb"
device_name = "/dev/sda1"
volume_size = 10
volume_type = "gp2"
delete_on_termination = true
}
}
build {
sources = [
"sources.amazon-ebssurrogate.almalinux-9-ami-x86_64",
"sources.amazon-ebssurrogate.almalinux-9-ami-aarch64"
]
provisioner "shell" {
inline = ["sudo dnf -y install ansible-core dosfstools"]
}
provisioner "ansible-local" {
playbook_dir = "./ansible"
playbook_file = "./ansible/ami-9-x86_64.yaml"
galaxy_file = "./ansible/requirements.yml"
only = [
"amazon-ebssurrogate.almalinux-9-ami-x86_64"
]
}
provisioner "ansible-local" {
playbook_dir = "./ansible"
playbook_file = "./ansible/ami-9-aarch64.yaml"
galaxy_file = "./ansible/requirements.yml"
only = [
"amazon-ebssurrogate.almalinux-9-ami-aarch64"
]
}
}