Skip to content

Commit

Permalink
Add cidr to terraform data
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Feb 20, 2025
1 parent 0403a09 commit 71bedcc
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions aws/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module "configuration" {
cloud_region = local.cloud_region
skip_upgrade = var.skip_upgrade
puppetfile = var.puppetfile
cidr = aws_subnet.subnet.cidr_block
}

module "provision" {
Expand Down
1 change: 1 addition & 0 deletions azure/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module "configuration" {
cloud_region = local.cloud_region
skip_upgrade = var.skip_upgrade
puppetfile = var.puppetfile
cidr = azurerm_subnet.subnet.address_prefixes[0]
}

module "provision" {
Expand Down
2 changes: 2 additions & 0 deletions common/configuration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ variable "public_keys" { }
variable "skip_upgrade" { }
variable "puppetfile" { }
variable "bastion_tag" { }
variable "cidr" { }

resource "tls_private_key" "ssh" {
algorithm = "ED25519"
Expand Down Expand Up @@ -68,6 +69,7 @@ locals {
terraform = {
instances = local.inventory
tag_ip = local.tag_ip
cidr = var.cidr
data = {
sudoer_username = var.sudoer_username
public_keys = var.public_keys
Expand Down
1 change: 1 addition & 0 deletions gcp/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module "configuration" {
cloud_region = local.cloud_region
skip_upgrade = var.skip_upgrade
puppetfile = var.puppetfile
cidr = google_compute_subnetwork.subnet.ip_cidr_range
}

module "provision" {
Expand Down
1 change: 1 addition & 0 deletions openstack/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module "configuration" {
cloud_region = local.cloud_region
skip_upgrade = var.skip_upgrade
puppetfile = var.puppetfile
cidr = local.cidr
}

module "provision" {
Expand Down
1 change: 1 addition & 0 deletions openstack/network-1.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ locals {
)
ext_networks = []
network_provision_dep = openstack_networking_floatingip_associate_v2.fip
cidr = openstack_networking_subnet_v2.subnet.cidr
}
3 changes: 2 additions & 1 deletion ovh/network-1.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "openstack_networking_subnet_v2" "subnet" {
name = "${var.cluster_name}_subnet"
network_id = openstack_networking_network_v2.int_network.id
ip_version = 4
cidr = "10.0.1.0/24"
cidr = local.cidr
no_gateway = true
enable_dhcp = true
}
Expand Down Expand Up @@ -46,4 +46,5 @@ locals {
name = data.openstack_networking_network_v2.ext_network.name
}]
network_provision_dep = openstack_compute_instance_v2.instances
cidr = "10.0.1.0/24"
}

0 comments on commit 71bedcc

Please sign in to comment.