-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcardano-node.pkr.hcl
62 lines (56 loc) · 1.5 KB
/
cardano-node.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
packer {
required_plugins {
# https://github.com/hashicorp/packer-plugin-amazon
amazon = {
source = "github.com/hashicorp/amazon"
version = ">= 1.1.0"
}
# https://github.com/hashicorp/packer-plugin-ansible
ansible = {
source = "github.com/hashicorp/ansible"
version = ">= 1.0.3"
}
}
}
data "amazon-ami" "ubuntu" {
most_recent = true
owners = ["099720109477"]
region = "us-east-1"
filters = {
name = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
}
locals {
hk_year_month_day = formatdate("YYYYMMDD", timeadd(timestamp(), "8h"))
}
source "amazon-ebs" "cardano-node" {
ami_groups = ["all"]
ami_name = "whslabs-cardano-node-${local.hk_year_month_day}"
communicator = "ssh"
force_delete_snapshot = true
force_deregister = true
instance_type = "t2.large"
region = "us-east-1"
source_ami = data.amazon-ami.ubuntu.id
ssh_username = "ubuntu"
aws_polling {
delay_seconds = 60
max_attempts = 60
}
launch_block_device_mappings {
delete_on_termination = true
device_name = "/dev/sda1"
volume_size = 20
volume_type = "gp2"
}
}
build {
sources = ["source.amazon-ebs.cardano-node"]
provisioner "ansible" {
playbook_file = "ansible/playbook.yaml"
use_proxy = false
user = "ubuntu"
}
}