Add possibility to enable or disable public_ip4
This commit is contained in:
parent
c878461d0f
commit
50899b5893
@ -5,6 +5,7 @@ module "private_server_group" {
|
|||||||
server_count = var.server_count
|
server_count = var.server_count
|
||||||
server_subnetwork_ip_range = var.subnetwork_ip_range
|
server_subnetwork_ip_range = var.subnetwork_ip_range
|
||||||
ssh_keys = var.ssh_keys
|
ssh_keys = var.ssh_keys
|
||||||
|
public_ipv4 = var.public_ipv4
|
||||||
}
|
}
|
||||||
|
|
||||||
module "loadbalancer" {
|
module "loadbalancer" {
|
||||||
@ -16,4 +17,5 @@ module "loadbalancer" {
|
|||||||
lb_external_ip = var.lb_external_ip
|
lb_external_ip = var.lb_external_ip
|
||||||
lb_service_id = var.lb_service_id
|
lb_service_id = var.lb_service_id
|
||||||
ssh_key_ids = module.private_server_group.ssh_key_ids
|
ssh_key_ids = module.private_server_group.ssh_key_ids
|
||||||
|
public_ipv4 = var.public_ipv4
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ resource "hcloud_server" "lb" {
|
|||||||
ssh_keys = var.ssh_key_ids
|
ssh_keys = var.ssh_key_ids
|
||||||
|
|
||||||
public_net {
|
public_net {
|
||||||
ipv4_enabled = true
|
ipv4_enabled = var.public_ipv4
|
||||||
ipv6_enabled = false
|
ipv6_enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,3 +53,9 @@ variable "ssh_key_ids" {
|
|||||||
description = "SSH key IDs to add to the loadbalancer server"
|
description = "SSH key IDs to add to the loadbalancer server"
|
||||||
type = list(number)
|
type = list(number)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "public_ipv4" {
|
||||||
|
description = ""
|
||||||
|
type = bool
|
||||||
|
default = false
|
||||||
|
}
|
||||||
|
@ -11,7 +11,7 @@ resource "hcloud_server" "private_node" {
|
|||||||
ssh_keys = hcloud_ssh_key.main[*].id
|
ssh_keys = hcloud_ssh_key.main[*].id
|
||||||
|
|
||||||
public_net {
|
public_net {
|
||||||
ipv4_enabled = true
|
ipv4_enabled = var.public_ipv4
|
||||||
ipv6_enabled = false
|
ipv6_enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,3 +47,9 @@ variable "ssh_keys" {
|
|||||||
description = "SSH keys to add to the servers"
|
description = "SSH keys to add to the servers"
|
||||||
type = list(string)
|
type = list(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "public_ipv4" {
|
||||||
|
description = ""
|
||||||
|
type = bool
|
||||||
|
default = false
|
||||||
|
}
|
||||||
|
@ -5,4 +5,5 @@ subnetwork_ip_range = "10.0.0.0/24"
|
|||||||
lb_internal_ip = "10.0.0.100"
|
lb_internal_ip = "10.0.0.100"
|
||||||
lb_external_ip = "167.235.105.161"
|
lb_external_ip = "167.235.105.161"
|
||||||
lb_service_id = 1399502
|
lb_service_id = 1399502
|
||||||
|
public_ipv4 = true
|
||||||
ssh_keys = ["rothe.pub", "alt.pub"]
|
ssh_keys = ["rothe.pub", "alt.pub"]
|
||||||
|
@ -43,3 +43,9 @@ variable "ssh_keys" {
|
|||||||
description = "SSH keys to add to servers"
|
description = "SSH keys to add to servers"
|
||||||
type = list(string)
|
type = list(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "public_ipv4" {
|
||||||
|
description = ""
|
||||||
|
type = bool
|
||||||
|
default = false
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user