Skip to content
Merged
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
10 changes: 9 additions & 1 deletion terraform/orchestrator/cloud-inits/cloud_config.tftpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#cloud-config

# SPDX-FileCopyrightText: 2025 Intel Corporation
# SPDX-FileCopyrightText: 2026 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -22,6 +22,14 @@ ntp:
- ${ntp_server}
%{ endif ~}
apt:
%{ if apt_mirror_country != "" ~}
primary:
- arches: [amd64, i386]
uri: http://${apt_mirror_country}.archive.ubuntu.com/ubuntu/
security:
- arches: [amd64, i386]
uri: http://${apt_mirror_country}.archive.ubuntu.com/ubuntu/
%{ endif ~}
%{ if http_proxy != "" ~}
http_proxy: ${http_proxy}
%{ endif ~}
Expand Down
3 changes: 2 additions & 1 deletion terraform/orchestrator/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025 Intel Corporation
# SPDX-FileCopyrightText: 2026 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -14,6 +14,7 @@ resource "local_file" "cloud_init_user_data_file" {
no_proxy = var.no_proxy,
ca_certs = [for ca_cert_paths in var.ca_certificates : indent(6, file(ca_cert_paths))], // Read CA certs into a list
enable_auto_install = var.enable_auto_install,
apt_mirror_country = var.apt_mirror_country,
},
)
filename = "${path.module}/files/user_data.cfg"
Expand Down
6 changes: 6 additions & 0 deletions terraform/orchestrator/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ variable "ca_certificates" {
default = []
}

variable "apt_mirror_country" {
type = string
description = "Country code for Ubuntu apt mirrors (e.g., 'us', 'de', 'uk'). Uses country-specific mirrors for faster package downloads."
default = "us"
}

variable "install_docker" {
type = bool
description = "Whether to install Docker on the VM."
Expand Down
Loading