-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DBP-817-calculat Mariadb_cluster_lan_cidr
- Loading branch information
Showing
2 changed files
with
23 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
locals { | ||
basic_vm_lan_ip = ionoscloud_nic.basic_vm_nic.ips[0] # Assuming the NIC has at least one IP address | ||
private_lan_cidr = "${cidrsubnet(ionoscloud_nic.basic_vm_nic.ips[0], 24, 0)}" # Assuming a /24 subnet | ||
mariadb_cluster_lan_cidr = "${cidrsubnet(local.private_lan_cidr, 4, 1)}" | ||
basic_vm_lan_ip = ionoscloud_nic.basic_vm_nic.ips[0] | ||
subnet_mask = 24 | ||
|
||
basic_vm_lan_cidr = "${local.basic_vm_lan_ip}/${local.subnet_mask}" | ||
|
||
private_lan_cidr = local.basic_vm_lan_cidr | ||
mariadb_cluster_lan_cidr = cidrsubnet(local.private_lan_cidr, 4, 1) | ||
mariadb_cluster_lan_ip = cidrhost(local.mariadb_cluster_lan_cidr, 9) | ||
} | ||
|
||
# let's assume that private LAN was created with a CIDR range of 10.0.0.0/24 | ||
# private_lan_cidr = 10.0.0.0/24 | ||
#basic_vm_lan_ip =10.0.0.9 | ||
#mariadb_cluster_lan_cidr=10.0.1.0 | ||
#mariadb_cluster_lan_ip = "10.0.1.10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
# output "dns_name" { | ||
# description = "The DNS name pointing to your cluster." | ||
# value = ionoscloud_mariadb_cluster.mariadb_cluster.dns_name | ||
# } | ||
|
||
output "private_lan_cidr" { | ||
description = "The CIDR range of the private LAN created for the basic VM and MariaDB cluster" | ||
value = local.private_lan_cidr | ||
output "basic_vm_lan_ip" { | ||
description = "The IP address assigned to the basic VM NIC" | ||
value = ionoscloud_nic.basic_vm_nic.ips[0] | ||
} | ||
|
||
output "private_lan_id" { | ||
description = "The ID of the private LAN created for the basic VM and MariaDB cluster" | ||
value = ionoscloud_lan.private_lan.id | ||
} | ||
output "basic_vm_server_id" { | ||
description = "The ID of the basic VM server" | ||
value = module.basic-vm.basic_vm_server_id | ||
output "mariadb_cluster_lan_ip" { | ||
description = "The IP address for the MariaDB cluster within the calculated CIDR range" | ||
value = local.mariadb_cluster_lan_ip | ||
} | ||
output "basic_vm_nic_id" { | ||
description = "The ID of the NIC attached to the basic VM" | ||
value = ionoscloud_nic.basic_vm_nic.id | ||
|
||
output "private_lan_cidr" { | ||
description = "represents the CIDR range of the private LAN created for the basic VM and MariaDB cluster" | ||
value = local.private_lan_cidr | ||
} | ||
|
||
output "mariadb_cluster_lan_cidr" { | ||
description = "The CIDR range of the LAN for the MariaDB cluster" | ||
description = "Is calculating the CIDR range for the MariaDB cluster LAN by taking a subnet of the private_lan_cidr" | ||
value = local.mariadb_cluster_lan_cidr | ||
} | ||
|
||
output "private_lan_id" { | ||
description = "The ID of the private LAN for the privacyidea VM and MariaDB cluster" | ||
value = data.ionoscloud_lan.private_lan.id | ||
} |