Closed VAdamec closed 8 years ago
Or at least this should works:
f5_pool_nodes = "10.4.21.141,10.4.21.142"
resource "bigip_ltm_node" "node" {
name = "${var.project_name}-${var.dcsim_name}-poc-idc-${var.dc_name}${format("%03d", count.index+1)}.${var.domain}"
address = "${element(split(",", var.f5_pool_nodes), count.index)}"
count = "${length(split(",", var.f5_pool_nodes))}"
}
resource "bigip_ltm_pool" "ltm_pool" {
name = "p_${var.project_name}-${var.dcsim_name}_poc"
load_balancing_mode = "round-robin"
nodes = ["${split(",", var.f5_pool_nodes)}"]
monitors = "${var.f5_pool_monitor}"
allow_snat = false
}
Errors:
* bigip_ltm_pool.ltm_pool: unexpected EOF
* bigip_ltm_node.node: unexpected EOF
* bigip_ltm_pool.ltm_pool: unexpected EOF
* bigip_ltm_node.node: unexpected EOF
* bigip_ltm_pool.ltm_pool: unexpected EOF
* bigip_ltm_pool.ltm_pool: connection is shut down
* bigip_ltm_node.node: connection is shut down
* bigip_ltm_node.node: connection is shut down
panic: Unknown kind: string
Sorry, i'm just idiot, this works:
variable "f5_pool_monitor" { default = "http" }
variable f5_pool_nodes = "10.0.0.2,10.0.0.3"
resource "bigip_ltm_node" "node" {
name = "${var.project_name}-${var.dcsim_name}-${var.dc_name}${format("%03d", count.index+1)}.${var.domain}"
address = "${element(split(",", var.f5_pool_nodes), count.index)}"
count = "${length(split(",", var.f5_pool_nodes))}"
}
resource "bigip_ltm_pool" "web_pool" {
name = "p_${var.project_name}-${var.dcsim_name}_demo"
load_balancing_mode = "round-robin"
nodes = ["${split(",", var.f5_pool_nodes)}"]
monitors = ["${split(",", var.f5_pool_monitor)}"]
allow_snat = false
}
resource "bigip_ltm_virtual_server" "vs_web" {
name = "v_${var.project_name}-${var.dcsim_name}_${var.f5_virtual_port}_demo"
destination = "${var.f5_virtual_ipaddress}"
port = "${var.f5_virtual_port}"
pool = "p_${var.project_name}-${var.dcsim_name}_poc"
source_address_translation = "automap"
}
yes, I'm an idiot, nodes, pools and virtual are created, but pool is empty
Try to modify on every application:
module.vsphere-habr.bigip_ltm_pool.web_pool: Modifying...
monitors.2541227442: "" => "http"
monitors.576276785: "/Common/http" => ""
nodes.#: "0" => "2"
nodes.1456672778: "" => "10.0.0.161"
nodes.3487187376: "" => "10.0.0.162"
module.vsphere-app.bigip_ltm_pool.web_pool: Modifying...
monitors.2541227442: "" => "http"
monitors.576276785: "/Common/http" => ""
nodes.#: "0" => "2"
nodes.1692758664: "" => "10.0.0.141"
nodes.4260111154: "" => "10.0.0.142"
module.vsphere-web.bigip_ltm_pool.web_pool: Modifying...
monitors.2541227442: "" => "http"
monitors.576276785: "/Common/http" => ""
nodes.#: "0" => "2"
nodes.2113815497: "" => "10.0.0.151"
nodes.3841397363: "" => "10.0.0.152"
module.vsphere-elk.bigip_ltm_pool.web_pool: Modifying...
monitors.2541227442: "" => "http"
monitors.576276785: "/Common/http" => ""
nodes.#: "0" => "2"
nodes.1338515787: "" => "10.0.0.171"
nodes.3603001585: "" => "10.0.0.172"
With port setup:
module.vsphere-web.bigip_ltm_pool.web_pool: Modifying...
monitors.2541227442: "" => "http"
monitors.576276785: "/Common/http" => ""
nodes.#: "0" => "2"
nodes.1164888747: "" => "10.4.21.151:8080"
nodes.3287988229: "" => "10.4.21.152:8080"
module.vsphere-habr.bigip_ltm_pool.web_pool: Modifying...
monitors.2541227442: "" => "http"
monitors.576276785: "/Common/http" => ""
nodes.#: "0" => "3"
nodes.0: "" => ""
nodes.1954992182: "" => "10.4.21.161:8080"
nodes.4061307544: "" => "10.4.21.162:8080"
module.vsphere-elk.bigip_ltm_pool.web_pool: Modifying...
monitors.2541227442: "" => "http"
monitors.576276785: "/Common/http" => ""
nodes.#: "0" => "2"
nodes.1415948588: "" => "10.4.21.172:8080"
nodes.3539065730: "" => "10.4.21.171:8080"
module.vsphere-app.bigip_ltm_pool.web_pool: Modifying...
monitors.2541227442: "" => "http"
monitors.576276785: "/Common/http" => ""
nodes.#: "0" => "2"
nodes.1703785393: "" => "10.4.21.142:8080"
nodes.3810115871: "" => "10.4.21.141:8080"
module.vsphere-web.bigip_ltm_pool.web_pool: Modifications complete
module.vsphere-elk.bigip_ltm_pool.web_pool: Modifications complete
module.vsphere-app.bigip_ltm_pool.web_pool: Modifications complete
module.vsphere-habr.bigip_ltm_pool.web_pool: Modifications complete
Apply complete! Resources: 0 added, 4 changed, 0 destroyed.
ip vs name of node, really my fault
How to insert multiple nodes to pool for example (cycle, terraform issue not bigip provider I presume) ? For example I'm creating nodes in cycle (and addresses counted based on some variables):
Maybe my approach is completely wrong, so just close it if it doesn't make sense.
LTM
virtual