Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions iac/nomad-cluster-disk-image/setup/install-consul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function install_binary {
local -r bin_dir="$install_path/bin"
local -r consul_dest_path="$bin_dir/consul"

unzip -d /tmp "$DOWNLOAD_PACKAGE_PATH"
unzip -o -d /tmp "$DOWNLOAD_PACKAGE_PATH"

log_info "Moving Consul binary to $consul_dest_path"
sudo mv "/tmp/consul" "$consul_dest_path"
Expand Down Expand Up @@ -243,4 +243,4 @@ function install {
fi
}

install "$@"
install "$@"
2 changes: 1 addition & 1 deletion iac/nomad-cluster-disk-image/setup/install-nomad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function install_binaries {

log_info "Downloading Nomad $version from $url to $download_path"
curl -o "$download_path" "$url"
unzip -d /tmp "$download_path"
unzip -o -d /tmp "$download_path"

log_info "Moving Nomad binary to $nomad_dest_path"
sudo mv "/tmp/nomad" "$nomad_dest_path"
Expand Down
11 changes: 10 additions & 1 deletion iac/provider-aws/nomad-cluster-disk-image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ init:
packer init -upgrade .

build:
packer build -var "prefix=$(PREFIX)" -var "aws_region=$(AWS_REGION)" -var "aws_profile=$(AWS_PROFILE)" -var "vpc_id=$(PACKER_VPC_ID)" -var "subnet_id=$(PACKER_SUBNET_ID)" .
packer build \
$(if $(PACKER_CONSUL_VERSION),-var "consul_version=$(PACKER_CONSUL_VERSION)") \
$(if $(PACKER_NOMAD_VERSION),-var "nomad_version=$(PACKER_NOMAD_VERSION)") \
$(if $(PACKER_VPC_ID),-var "vpc_id=$(PACKER_VPC_ID)") \
$(if $(PACKER_SUBNET_ID),-var "subnet_id=$(PACKER_SUBNET_ID)") \
$(if $(PACKER_SOURCE_AMI_FILTER_NAME),-var "source_ami_filter_name=$(PACKER_SOURCE_AMI_FILTER_NAME)") \
-var "prefix=$(PREFIX)" \
-var "aws_region=$(AWS_REGION)" \
-var "aws_profile=$(AWS_PROFILE)" \
.

format:
packer fmt .
2 changes: 1 addition & 1 deletion iac/provider-aws/nomad-cluster-disk-image/main.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ source "amazon-ebs" "ubuntu" {
// Ubuntu Server 24.04 LTS (HVM), SSD Volume Type
source_ami_filter {
filters = {
name = "ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*"
name = var.source_ami_filter_name
root-device-type = "ebs"
virtualization-type = "hvm"
}
Expand Down
5 changes: 5 additions & 0 deletions iac/provider-aws/nomad-cluster-disk-image/variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ variable "aws_profile" {
type = string
}

variable "source_ami_filter_name" {
type = string
default = "ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*"
}

variable "prefix" {
type = string
}
Expand Down
10 changes: 9 additions & 1 deletion iac/provider-gcp/nomad-cluster-disk-image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ init:
build:
terraform init -input=false -reconfigure -backend-config="bucket=${TERRAFORM_STATE_BUCKET}"
$(tf_vars) terraform apply -auto-approve -input=false -compact-warnings
packer build -var "gcp_project_id=$(GCP_PROJECT_ID)" -var "gcp_zone=$(GCP_ZONE)" -var "network_name=$(PACKER_NETWORK_NAME)" -var "subnet_name=$(PACKER_SUBNET_NAME)" .
packer build \
$(if $(PACKER_CONSUL_VERSION),-var "consul_version=$(PACKER_CONSUL_VERSION)") \
$(if $(PACKER_NOMAD_VERSION),-var "nomad_version=$(PACKER_NOMAD_VERSION)") \
$(if $(PACKER_NETWORK_NAME),-var "network_name=$(PACKER_NETWORK_NAME)") \
$(if $(PACKER_SUBNET_NAME),-var "subnet_name=$(PACKER_SUBNET_NAME)") \
$(if $(PACKER_SOURCE_IMAGE),-var "source_image=$(PACKER_SOURCE_IMAGE)") \
-var "gcp_project_id=$(GCP_PROJECT_ID)" \
-var "gcp_zone=$(GCP_ZONE)" \
.

format:
packer fmt .
2 changes: 1 addition & 1 deletion iac/provider-gcp/nomad-cluster-disk-image/main.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source "googlecompute" "orch" {
# TODO: Overwrite the image instead of creating timestamped images every time we build its
image_name = "${var.prefix}orch-${formatdate("YYYY-MM-DD-hh-mm-ss", timestamp())}"
project_id = var.gcp_project_id
source_image = "ubuntu-2404-noble-amd64-v20260517"
source_image = var.source_image
ssh_username = "ubuntu"
zone = var.gcp_zone
disk_size = 10
Expand Down
5 changes: 5 additions & 0 deletions iac/provider-gcp/nomad-cluster-disk-image/variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ variable "cni_plugin_version" {
type = string
default = "v1.6.2"
}

variable "source_image" {
type = string
default = "ubuntu-2404-noble-amd64-v20260517"
}
Loading