Slide 27
Slide 27 text
)BTIJ$PSQ.FFUVQSE
module "reserved_vip" {
source = "../reserved_vip"
count = "${var.int_vip_count}"
name = "${var.role}"
network = "${var.network}"
}
module "pairaddress_port" {
source = "../pairaddress_port"
count = "${var.count}"
network = "${var.network}"
security_group_ids = ["${values(var.security_groups)}"]
use_floating_ip = false
allowed_ip_address = "${data.openstack_networking_subnet_v2.subnet.cidr}"
role = "${var.role}"
}
resource "openstack_compute_instance_v2" "instance" {
lifecycle {
ignore_changes = ["user_data", "key_pair", "image_name", "availability_zone"]
}
count = "${var.count}"
name = "${terraform.env != "staging" ? "" : "staging-"}${var.role}-${count.index + var.count_offset +
1}.${var.domain}"
image_name = "${var.image_name}"
flavor_name = "${var.flavor_name}"
key_pair = "${var.key_pair}"
availability_zone = "${var.availability_zones[(count.index + var.count_offset) % length(var.availability_zones)]}"
security_groups = ["${keys(var.security_groups)}"]
user_data = "${data.template_file.init.rendered}"
network {
port = "${element(module.pairaddress_port.ids, count.index)}"
modules/
├── instance
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
├── instance_with_extvip
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
├── instance_with_intvip
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
├── pairaddress_port
│ ├── main.tf
│ ├── outputs.tf
│ └── varaibales.tf
├── reserved_vip
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
└── volume
├── main.tf
└── variables.tf
5FSSBGPSNࡉ͔۠ͬͨ͘NPEVMFͷྫ