pipeline-testing-improvements #9
@@ -25,27 +25,34 @@ resource "proxmox_cloud_init_disk" "ci" {
|
|||||||
: ""}
|
: ""}
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
# Network configuration - static IP or DHCP
|
# Network configuration - static IP or DHCP
|
||||||
network_config = yamlencode({
|
network_config = each.value.ip != null ? yamlencode({
|
||||||
version = 1
|
version = 1
|
||||||
config = [{
|
config = [{
|
||||||
type = "physical"
|
type = "physical"
|
||||||
name = "ens18"
|
name = "ens18"
|
||||||
subnets = each.value.ip != null ? [{
|
subnets = [{
|
||||||
type = "static"
|
type = "static"
|
||||||
address = each.value.ip
|
address = each.value.ip
|
||||||
gateway = each.value.gateway
|
gateway = each.value.gateway
|
||||||
dns_nameservers = split(" ", each.value.nameservers)
|
dns_nameservers = split(" ", each.value.nameservers)
|
||||||
dns_search = [each.value.search_domain]
|
dns_search = [each.value.search_domain]
|
||||||
}] : [{
|
}]
|
||||||
|
}]
|
||||||
|
}) : yamlencode({
|
||||||
|
version = 1
|
||||||
|
config = [{
|
||||||
|
type = "physical"
|
||||||
|
name = "ens18"
|
||||||
|
subnets = [{
|
||||||
type = "dhcp"
|
type = "dhcp"
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
# Instance metadata
|
# Instance metadata
|
||||||
meta_data = yamlencode({
|
meta_data = yamlencode({
|
||||||
instance_id = sha1(each.key)
|
instance_id = sha1(each.key)
|
||||||
local-hostname = each.key
|
local-hostname = each.key
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user