Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions environments/site/tofu/additional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module "additional" {
cluster_domain_suffix = var.cluster_domain_suffix
key_pair = var.key_pair
environment_root = var.environment_root
config_drive = var.config_drive

# can be set for group, defaults to top-level value:
image_id = lookup(each.value, "image_id", var.cluster_image_id)
Expand Down
2 changes: 2 additions & 0 deletions environments/site/tofu/compute.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module "compute" {
cluster_domain_suffix = var.cluster_domain_suffix
key_pair = var.key_pair
environment_root = var.environment_root
config_drive = var.config_drive

# can be set for group, defaults to top-level value:
image_id = lookup(each.value, "image_id", var.cluster_image_id)
Expand Down Expand Up @@ -60,4 +61,5 @@ module "compute" {
"gateway_ip",
"nodename_template",
]

}
2 changes: 2 additions & 0 deletions environments/site/tofu/control.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,6 @@ resource "openstack_compute_instance_v2" "control" {
%{endif}
EOF

config_drive = var.config_drive

}
2 changes: 2 additions & 0 deletions environments/site/tofu/login.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module "login" {
cluster_domain_suffix = var.cluster_domain_suffix
key_pair = var.key_pair
environment_root = var.environment_root
config_drive = var.config_drive

# can be set for group, defaults to top-level value:
image_id = lookup(each.value, "image_id", var.cluster_image_id)
Expand Down Expand Up @@ -64,4 +65,5 @@ module "login" {
"gateway_ip",
"nodename_template",
]

}
5 changes: 5 additions & 0 deletions environments/site/tofu/node_group/nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ resource "openstack_blockstorage_volume_v3" "compute" {
name = "${var.cluster_name}-${each.key}"
description = "Compute node ${each.value.node} volume ${each.value.volume}"
size = var.extra_volumes[each.value.volume].size
volume_type = var.extra_volumes[each.value.volume].volume_type
}

resource "openstack_compute_volume_attach_v2" "compute" {
Expand Down Expand Up @@ -119,6 +120,8 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {

availability_zone = var.match_ironic_node ? "${local.baremetal_az}::${var.baremetal_nodes[each.key]}" : var.availability_zone

config_drive = var.config_drive

lifecycle {
ignore_changes = [
image_id,
Expand Down Expand Up @@ -174,6 +177,8 @@ resource "openstack_compute_instance_v2" "compute" {

availability_zone = var.match_ironic_node ? "${local.baremetal_az}::${var.baremetal_nodes[each.key]}" : var.availability_zone

config_drive = var.config_drive

}

resource "openstack_networking_floatingip_associate_v2" "fip" {
Expand Down
6 changes: 6 additions & 0 deletions environments/site/tofu/node_group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ variable "extra_volumes" {
Keys are unique volume name.
Values are a mapping with:
size: Size of volume in GB
volume_type: Optional. Type of volume, or cloud default
**NB**: The order in /dev is not guaranteed to match the mapping
EOF
type = map(
object({
size = number
volume_type = optional(string)
})
)
default = {}
Expand Down Expand Up @@ -190,3 +192,7 @@ variable "allowed_keys" {
type = list
# don't provide a default here as allowed keys may depend on module use
}

variable "config_drive" {
type = bool
}
17 changes: 14 additions & 3 deletions environments/site/tofu/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ variable "login" {
volume_backed_instances: Overrides variable volume_backed_instances
root_volume_size: Overrides variable root_volume_size
extra_volumes: Mapping defining additional volumes to create and attach
Keys are unique volume name.
Values are a mapping with:
Keys are unique volume name.
Values are a mapping with:
size: Size of volume in GB
**NB**: The order in /dev is not guaranteed to match the mapping
volume_type: Optional. Type of volume, or cloud default
**NB**: The order in /dev is not guaranteed to match the mapping
fip_addresses: List of addresses of floating IPs to associate with
nodes, in the same order as nodes parameter. The
floating IPs must already be allocated to the project.
Expand Down Expand Up @@ -117,6 +118,7 @@ variable "compute" {
Keys are unique volume name.
Values are a mapping with:
size: Size of volume in GB
volume_type: Optional. Type of volume, or cloud default
**NB**: The order in /dev is not guaranteed to match the mapping
ip_addresses: Mapping of list of fixed IP addresses for nodes, keyed
by network name, in same order as nodes parameter.
Expand Down Expand Up @@ -311,3 +313,12 @@ variable "cluster_nodename_template" {
type = string
default = "$${cluster_name}-$${node}.$${cluster_name}.$${cluster_domain_suffix}"
}

variable "config_drive" {
description = <<-EOT
Whether to enable Nova config drives on all nodes, which will attach a drive containing
information usually provided through the metadata service.
EOT
type = bool
default = null
}
Loading