Skip to content

Commit 82a9a3b

Browse files
committed
Allow definition of upgrade value per instance
1 parent 7d80de3 commit 82a9a3b

8 files changed

Lines changed: 10 additions & 9 deletions

File tree

aws/infrastructure.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module "design" {
1414
volumes = var.volumes
1515
firewall_rules = var.firewall_rules
1616
bastion_tags = var.bastion_tags
17+
upgrade = var.upgrade
1718
}
1819

1920
module "configuration" {
@@ -31,7 +32,6 @@ module "configuration" {
3132
software_stack = var.software_stack
3233
cloud_provider = local.cloud_provider
3334
cloud_region = local.cloud_region
34-
upgrade = var.upgrade
3535
puppet_conf = var.puppet_conf
3636
}
3737

azure/infrastructure.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module "design" {
1414
volumes = var.volumes
1515
firewall_rules = var.firewall_rules
1616
bastion_tags = var.bastion_tags
17+
upgrade = var.upgrade
1718
}
1819

1920
module "configuration" {
@@ -31,7 +32,6 @@ module "configuration" {
3132
software_stack = var.software_stack
3233
cloud_provider = local.cloud_provider
3334
cloud_region = local.cloud_region
34-
upgrade = var.upgrade
3535
puppet_conf = var.puppet_conf
3636
}
3737

common/configuration/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ variable "guest_passwd" {}
2323

2424
variable "public_keys" {}
2525

26-
variable "upgrade" {}
2726
variable "bastion_tags" {}
2827

2928
resource "tls_private_key" "ssh" {
@@ -127,7 +126,7 @@ locals {
127126
ssh_authorized_keys = local.public_keys
128127
tf_ssh_public_key = chomp(tls_private_key.ssh.public_key_openssh)
129128
terraform_facts = local.terraform_facts
130-
upgrade = var.upgrade
129+
upgrade = values.upgrade
131130
module_path = path.module
132131
user_tf_required = contains(values.tags, "puppet") || length(setintersection(values.tags, var.bastion_tags)) > 0
133132
hostkeys = {

common/design/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ locals {
1515
for i in range(lookup(attrs, "count", 1)) : {
1616
(format("%s%d", prefix, i + 1)) = merge(
1717
{ image = var.image },
18+
{ upgrade = var.upgrade },
1819
{ disk_size = max(var.min_disk_size, [for tag in attrs.tags : lookup(local.min_disk_size_per_tags, tag, 0)]...) },
1920
{ for attr, value in attrs : attr => value if !contains(["count"], attr) },
2021
{
2122
prefix = prefix,
22-
specs = { for attr, value in attrs : attr => value if !contains(["count", "tags", "image"], attr) }
23+
specs = { for attr, value in attrs : attr => value if !contains(["count", "tags", "image", "upgrade"], attr) }
2324
},
2425
)
2526
}

common/design/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ variable "pool" {}
66
variable "firewall_rules" {}
77
variable "min_disk_size" {}
88
variable "image" {}
9-
variable "bastion_tags" {}
9+
variable "bastion_tags" {}
10+
variable "upgrade" {}

gcp/infrastructure.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module "design" {
1414
volumes = var.volumes
1515
firewall_rules = var.firewall_rules
1616
bastion_tags = var.bastion_tags
17+
upgrade = var.upgrade
1718
}
1819

1920
module "configuration" {
@@ -31,7 +32,6 @@ module "configuration" {
3132
software_stack = var.software_stack
3233
cloud_provider = local.cloud_provider
3334
cloud_region = local.cloud_region
34-
upgrade = var.upgrade
3535
puppet_conf = var.puppet_conf
3636
}
3737

incus/infrastructure.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module "design" {
99
volumes = var.volumes
1010
firewall_rules = var.firewall_rules
1111
bastion_tags = var.bastion_tags
12+
upgrade = var.upgrade
1213
}
1314

1415
module "configuration" {
@@ -27,7 +28,6 @@ module "configuration" {
2728
software_stack = var.software_stack
2829
cloud_provider = "incus"
2930
cloud_region = "local"
30-
upgrade = var.upgrade
3131
puppet_conf = var.puppet_conf
3232
}
3333

openstack/infrastructure.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module "design" {
99
volumes = var.volumes
1010
firewall_rules = var.firewall_rules
1111
bastion_tags = var.bastion_tags
12+
upgrade = var.upgrade
1213
}
1314

1415
module "configuration" {
@@ -26,7 +27,6 @@ module "configuration" {
2627
software_stack = var.software_stack
2728
cloud_provider = local.cloud_provider
2829
cloud_region = local.cloud_region
29-
upgrade = var.upgrade
3030
puppet_conf = var.puppet_conf
3131
}
3232

0 commit comments

Comments
 (0)