Skip to content

Commit f095b50

Browse files
committed
Added config drive option to tofu
1 parent f3013f0 commit f095b50

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

environments/site/tofu/compute.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@ module "compute" {
6060
"gateway_ip",
6161
"nodename_template",
6262
]
63+
64+
config_drive = var.config_drive
65+
6366
}

environments/site/tofu/control.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,6 @@ resource "openstack_compute_instance_v2" "control" {
9494
%{endif}
9595
EOF
9696

97+
config_drive = var.config_drive
98+
9799
}

environments/site/tofu/login.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,7 @@ module "login" {
6464
"gateway_ip",
6565
"nodename_template",
6666
]
67+
68+
config_drive = var.config_drive
69+
6770
}

environments/site/tofu/node_group/nodes.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
120120

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

123+
config_drive = var.config_drive
124+
123125
lifecycle {
124126
ignore_changes = [
125127
image_id,
@@ -175,6 +177,8 @@ resource "openstack_compute_instance_v2" "compute" {
175177

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

180+
config_drive = var.config_drive
181+
178182
}
179183

180184
resource "openstack_networking_floatingip_associate_v2" "fip" {

environments/site/tofu/node_group/variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,12 @@ variable "allowed_keys" {
192192
type = list
193193
# don't provide a default here as allowed keys may depend on module use
194194
}
195+
196+
variable "config_drive" {
197+
description = <<-EOT
198+
Whether to enable Nova config drives on all nodes, which will mount a drive containing
199+
information that would usually be available through the metadata service.
200+
EOT
201+
type = bool
202+
default = false
203+
}

environments/site/tofu/variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,12 @@ variable "cluster_nodename_template" {
313313
type = string
314314
default = "$${cluster_name}-$${node}.$${cluster_name}.$${cluster_domain_suffix}"
315315
}
316+
317+
variable "config_drive" {
318+
description = <<-EOT
319+
Whether to enable Nova config drives on all nodes, which will mount a drive containing
320+
information that would usually be available through the metadata service.
321+
EOT
322+
type = bool
323+
default = false
324+
}

0 commit comments

Comments
 (0)