diff --git a/examples/vpc/kubernetes_cluster/main.tf b/examples/vpc/kubernetes_cluster/main.tf index 0ae3c01..d49b1a4 100644 --- a/examples/vpc/kubernetes_cluster/main.tf +++ b/examples/vpc/kubernetes_cluster/main.tf @@ -26,15 +26,15 @@ module "kubernetes_cluster" { os_region = "${var.os_region}" # Kubernetes cluster common parameters. - cluster_name = "${var.cluster_name}" - cluster_zone = "${var.cluster_zone}" - cluster_kube_version = "${var.cluster_kube_version}" - cluster_ssh_key = "${file("~/.ssh/id_rsa.pub")}" - cluster_ssh_key_user = "${module.project_with_user.user_id}" - cluster_master_lb_enabled = "${var.cluster_master_lb_enabled}" - cluster_master_floating_ip = "${var.cluster_master_floating_ip}" - cluster_docker_volume_size = "${var.cluster_docker_volume_size}" - cluster_etcd_volume_size = "${var.cluster_etcd_volume_size}" + cluster_name = "${var.cluster_name}" + cluster_zone = "${var.cluster_zone}" + cluster_kube_version = "${var.cluster_kube_version}" + cluster_ssh_key = "${file("~/.ssh/id_rsa.pub")}" + cluster_ssh_key_user = "${module.project_with_user.user_id}" + cluster_master_lb_enabled = "${var.cluster_master_lb_enabled}" + cluster_master_floating_ip = "${var.cluster_master_floating_ip}" + cluster_docker_volume_size = "${var.cluster_docker_volume_size}" + cluster_etcd_volume_size = "${var.cluster_etcd_volume_size}" # Kubernetes cluster masters parameters. cluster_master_count = "${var.cluster_master_count}" @@ -45,4 +45,4 @@ module "kubernetes_cluster" { cluster_node_count = "${var.cluster_node_count}" cluster_node_vcpus = "${var.cluster_node_vcpus}" cluster_node_ram = "${var.cluster_node_ram}" -} \ No newline at end of file +} diff --git a/examples/vpc/kubernetes_cluster/vars.tf b/examples/vpc/kubernetes_cluster/vars.tf index bdcb9c8..c0c0526 100644 --- a/examples/vpc/kubernetes_cluster/vars.tf +++ b/examples/vpc/kubernetes_cluster/vars.tf @@ -74,4 +74,4 @@ variable "cluster_etcd_volume_size" { variable "cluster_master_floating_ip" { default = "True" -} \ No newline at end of file +} diff --git a/examples/vpc/server_local_and_remote_disks/main.tf b/examples/vpc/server_local_and_remote_disks/main.tf index 0d66500..efcc9eb 100644 --- a/examples/vpc/server_local_and_remote_disks/main.tf +++ b/examples/vpc/server_local_and_remote_disks/main.tf @@ -1,6 +1,6 @@ # Initialize Selectel provider with token. provider "selectel" { - token = "${var.sel_token}" + token = "${var.sel_token}" } # Create the main project with user. @@ -37,4 +37,4 @@ module "server_local_and_remote_disks" { server_image_name = "${var.server_image_name}" server_ssh_key = "${file("~/.ssh/id_rsa.pub")}" server_ssh_key_user = "${module.project_with_user.user_id}" -} \ No newline at end of file +} diff --git a/examples/vpc/server_local_root_disk/main.tf b/examples/vpc/server_local_root_disk/main.tf index 555a1ca..80ab482 100644 --- a/examples/vpc/server_local_root_disk/main.tf +++ b/examples/vpc/server_local_root_disk/main.tf @@ -1,6 +1,6 @@ # Initialize Selectel provider with token. provider "selectel" { - token = "${var.sel_token}" + token = "${var.sel_token}" } # Create the main project with user. @@ -35,4 +35,4 @@ module "server_local_root_disk" { server_image_name = "${var.server_image_name}" server_ssh_key = "${file("~/.ssh/id_rsa.pub")}" server_ssh_key_user = "${module.project_with_user.user_id}" -} \ No newline at end of file +} diff --git a/examples/vpc/server_remote_root_disk/main.tf b/examples/vpc/server_remote_root_disk/main.tf index 5cede01..eb9594e 100644 --- a/examples/vpc/server_remote_root_disk/main.tf +++ b/examples/vpc/server_remote_root_disk/main.tf @@ -35,4 +35,4 @@ module "server_remote_root_disk" { server_image_name = "${var.server_image_name}" server_ssh_key = "${file("~/.ssh/id_rsa.pub")}" server_ssh_key_user = "${module.project_with_user.user_id}" -} \ No newline at end of file +} diff --git a/examples/vpc/server_remote_root_disk/vars.tf b/examples/vpc/server_remote_root_disk/vars.tf index 7a78c6e..9b8af9b 100644 --- a/examples/vpc/server_remote_root_disk/vars.tf +++ b/examples/vpc/server_remote_root_disk/vars.tf @@ -11,7 +11,7 @@ variable "user_name" {} variable "user_password" {} variable "keypair_name" { - default= "tf_keypair" + default = "tf_keypair" } variable "os_auth_url" { diff --git a/examples/vpc/server_remote_root_disk_two_ports/main.tf b/examples/vpc/server_remote_root_disk_two_ports/main.tf index 59c30ee..76ba3ad 100644 --- a/examples/vpc/server_remote_root_disk_two_ports/main.tf +++ b/examples/vpc/server_remote_root_disk_two_ports/main.tf @@ -35,4 +35,4 @@ module "server_remote_root_disk_two_ports" { server_image_name = "${var.server_image_name}" server_ssh_key = "${file("~/.ssh/id_rsa.pub")}" server_ssh_key_user = "${module.project_with_user.user_id}" -} \ No newline at end of file +} diff --git a/modules/vpc/keypair/outputs.tf b/modules/vpc/keypair/outputs.tf index 8988cf4..ceb3dd7 100644 --- a/modules/vpc/keypair/outputs.tf +++ b/modules/vpc/keypair/outputs.tf @@ -4,4 +4,4 @@ output "keypair_id" { output "keypair_name" { value = "${selectel_vpc_keypair_v2.keypair_1.name}" -} \ No newline at end of file +} diff --git a/modules/vpc/kubernetes_cluster/main.tf b/modules/vpc/kubernetes_cluster/main.tf index b2c1d8d..9c7ddcc 100644 --- a/modules/vpc/kubernetes_cluster/main.tf +++ b/modules/vpc/kubernetes_cluster/main.tf @@ -14,17 +14,17 @@ resource "random_string" "random_name" { } module "master_flavor" { - source = "../flavor" - flavor_name = "flavor-master-${random_string.random_name.result}" - flavor_vcpus = "${var.cluster_master_vcpus}" - flavor_ram_mb = "${var.cluster_master_ram}" + source = "../flavor" + flavor_name = "flavor-master-${random_string.random_name.result}" + flavor_vcpus = "${var.cluster_master_vcpus}" + flavor_ram_mb = "${var.cluster_master_ram}" } module "flavor" { - source = "../flavor" - flavor_name = "flavor-${random_string.random_name.result}" - flavor_vcpus = "${var.cluster_node_vcpus}" - flavor_ram_mb = "${var.cluster_node_ram}" + source = "../flavor" + flavor_name = "flavor-${random_string.random_name.result}" + flavor_vcpus = "${var.cluster_node_vcpus}" + flavor_ram_mb = "${var.cluster_node_ram}" } module "image_datasource" { @@ -58,6 +58,7 @@ resource "openstack_containerinfra_clustertemplate_v1" "clustertemplate_1" { master_lb_enabled = "${var.cluster_master_lb_enabled}" floating_ip_enabled = false external_network_id = "${data.openstack_networking_network_v2.external_net.id}" + labels = { kube_tag = "${var.cluster_kube_version}" kube_dashboard_enabled = "${var.cluster_kube_dashboard_enabled}" diff --git a/modules/vpc/kubernetes_cluster/vars.tf b/modules/vpc/kubernetes_cluster/vars.tf index 8e2c04c..92b385d 100644 --- a/modules/vpc/kubernetes_cluster/vars.tf +++ b/modules/vpc/kubernetes_cluster/vars.tf @@ -88,4 +88,4 @@ variable cluster_etcd_volume_size { variable cluster_master_floating_ip { default = "false" -} \ No newline at end of file +} diff --git a/modules/vpc/nat/main.tf b/modules/vpc/nat/main.tf index fba8072..fe609ac 100644 --- a/modules/vpc/nat/main.tf +++ b/modules/vpc/nat/main.tf @@ -13,11 +13,11 @@ resource "openstack_networking_network_v2" "network_1" { resource "openstack_networking_subnet_v2" "subnet_1" { network_id = "${openstack_networking_network_v2.network_1.id}" - name = "${var.subnet_cidr}" - cidr = "${var.subnet_cidr}" + name = "${var.subnet_cidr}" + cidr = "${var.subnet_cidr}" } resource "openstack_networking_router_interface_v2" "router_interface_1" { router_id = "${openstack_networking_router_v2.router_1.id}" subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}" -} \ No newline at end of file +} diff --git a/modules/vpc/nat/outputs.tf b/modules/vpc/nat/outputs.tf index 05dcfa4..b7ddd73 100644 --- a/modules/vpc/nat/outputs.tf +++ b/modules/vpc/nat/outputs.tf @@ -8,4 +8,4 @@ output "network_id" { output "subnet_id" { value = "${openstack_networking_subnet_v2.subnet_1.id}" -} \ No newline at end of file +} diff --git a/modules/vpc/nat/vars.tf b/modules/vpc/nat/vars.tf index b7a25fb..2680ad5 100644 --- a/modules/vpc/nat/vars.tf +++ b/modules/vpc/nat/vars.tf @@ -12,4 +12,4 @@ variable "network_name" { variable "subnet_cidr" { default = "192.168.0.0/24" -} \ No newline at end of file +} diff --git a/modules/vpc/project_with_user/main.tf b/modules/vpc/project_with_user/main.tf index 47c7d43..29781cf 100644 --- a/modules/vpc/project_with_user/main.tf +++ b/modules/vpc/project_with_user/main.tf @@ -13,4 +13,4 @@ module "role" { source = "../role" role_project_id = "${module.project.project_id}" role_user_id = "${module.user.user_id}" -} \ No newline at end of file +} diff --git a/modules/vpc/project_with_user/vars.tf b/modules/vpc/project_with_user/vars.tf index 4dfaceb..bd5f5ec 100644 --- a/modules/vpc/project_with_user/vars.tf +++ b/modules/vpc/project_with_user/vars.tf @@ -1,9 +1,9 @@ variable "project_name" { - default = "tf_project" + default = "tf_project" } variable "user_name" { - default = "tf_user" + default = "tf_user" } variable "user_password" {} diff --git a/modules/vpc/server_local_and_remote_disks/main.tf b/modules/vpc/server_local_and_remote_disks/main.tf index ad5193f..143b98f 100644 --- a/modules/vpc/server_local_and_remote_disks/main.tf +++ b/modules/vpc/server_local_and_remote_disks/main.tf @@ -19,6 +19,7 @@ module "flavor" { flavor_vcpus = "${var.server_vcpus}" flavor_ram_mb = "${var.server_ram_mb}" flavor_local_disk_gb = "${var.server_root_disk_gb}" + lifecycle { create_before_destroy = false } @@ -29,8 +30,9 @@ module "nat" { } resource "openstack_networking_port_v2" "port_1" { - name = "${var.server_name}-eth0" - network_id = "${module.nat.network_id}" + name = "${var.server_name}-eth0" + network_id = "${module.nat.network_id}" + fixed_ip { subnet_id = "${module.nat.subnet_id}" } @@ -97,4 +99,4 @@ module "floatingip" { resource "openstack_networking_floatingip_associate_v2" "association_1" { port_id = "${openstack_networking_port_v2.port_1.id}" floating_ip = "${module.floatingip.floatingip_address}" -} \ No newline at end of file +} diff --git a/modules/vpc/server_local_and_remote_disks/vars.tf b/modules/vpc/server_local_and_remote_disks/vars.tf index ac5d62a..06a7b20 100644 --- a/modules/vpc/server_local_and_remote_disks/vars.tf +++ b/modules/vpc/server_local_and_remote_disks/vars.tf @@ -42,4 +42,4 @@ variable "server_zone" { variable "server_ssh_key" {} -variable "server_ssh_key_user" {} \ No newline at end of file +variable "server_ssh_key_user" {} diff --git a/modules/vpc/server_local_root_disk/main.tf b/modules/vpc/server_local_root_disk/main.tf index d93b7c0..9da3586 100644 --- a/modules/vpc/server_local_root_disk/main.tf +++ b/modules/vpc/server_local_root_disk/main.tf @@ -26,8 +26,9 @@ module "nat" { } resource "openstack_networking_port_v2" "port_1" { - name = "${var.server_name}-eth0" - network_id = "${module.nat.network_id}" + name = "${var.server_name}-eth0" + network_id = "${module.nat.network_id}" + fixed_ip { subnet_id = "${module.nat.subnet_id}" } diff --git a/modules/vpc/server_local_root_disk/vars.tf b/modules/vpc/server_local_root_disk/vars.tf index 8371962..f173853 100644 --- a/modules/vpc/server_local_root_disk/vars.tf +++ b/modules/vpc/server_local_root_disk/vars.tf @@ -34,4 +34,4 @@ variable "server_zone" { variable "server_ssh_key" {} -variable "server_ssh_key_user" {} \ No newline at end of file +variable "server_ssh_key_user" {} diff --git a/modules/vpc/server_remote_root_disk/main.tf b/modules/vpc/server_remote_root_disk/main.tf index 2560e51..900241a 100644 --- a/modules/vpc/server_remote_root_disk/main.tf +++ b/modules/vpc/server_remote_root_disk/main.tf @@ -14,10 +14,10 @@ resource "random_string" "random_name" { } module "flavor" { - source = "../flavor" - flavor_name = "flavor-${random_string.random_name.result}" - flavor_vcpus = "${var.server_vcpus}" - flavor_ram_mb = "${var.server_ram_mb}" + source = "../flavor" + flavor_name = "flavor-${random_string.random_name.result}" + flavor_vcpus = "${var.server_vcpus}" + flavor_ram_mb = "${var.server_ram_mb}" } module "nat" { @@ -25,8 +25,9 @@ module "nat" { } resource "openstack_networking_port_v2" "port_1" { - name = "${var.server_name}-eth0" - network_id = "${module.nat.network_id}" + name = "${var.server_name}-eth0" + network_id = "${module.nat.network_id}" + fixed_ip { subnet_id = "${module.nat.subnet_id}" } @@ -85,4 +86,4 @@ module "floatingip" { resource "openstack_networking_floatingip_associate_v2" "association_1" { port_id = "${openstack_networking_port_v2.port_1.id}" floating_ip = "${module.floatingip.floatingip_address}" -} \ No newline at end of file +} diff --git a/modules/vpc/server_remote_root_disk/vars.tf b/modules/vpc/server_remote_root_disk/vars.tf index 29ead15..511c297 100644 --- a/modules/vpc/server_remote_root_disk/vars.tf +++ b/modules/vpc/server_remote_root_disk/vars.tf @@ -38,4 +38,4 @@ variable "server_zone" { variable "server_ssh_key" {} -variable "server_ssh_key_user" {} \ No newline at end of file +variable "server_ssh_key_user" {} diff --git a/modules/vpc/server_remote_root_disk_two_ports/main.tf b/modules/vpc/server_remote_root_disk_two_ports/main.tf index c7bee04..b18511c 100644 --- a/modules/vpc/server_remote_root_disk_two_ports/main.tf +++ b/modules/vpc/server_remote_root_disk_two_ports/main.tf @@ -14,10 +14,10 @@ resource "random_string" "random_name" { } module "flavor" { - source = "../flavor" - flavor_name = "flavor-${random_string.random_name.result}" - flavor_vcpus = "${var.server_vcpus}" - flavor_ram_mb = "${var.server_ram_mb}" + source = "../flavor" + flavor_name = "flavor-${random_string.random_name.result}" + flavor_vcpus = "${var.server_vcpus}" + flavor_ram_mb = "${var.server_ram_mb}" } module "nat" { @@ -32,16 +32,18 @@ resource "openstack_networking_subnet_v2" "subnet_2" { } resource "openstack_networking_port_v2" "port_1" { - name = "${var.server_name}-eth0" - network_id = "${module.nat.network_id}" + name = "${var.server_name}-eth0" + network_id = "${module.nat.network_id}" + fixed_ip { subnet_id = "${module.nat.subnet_id}" } } resource "openstack_networking_port_v2" "port_2" { - name = "${var.server_name}-eth1" - network_id = "${module.nat.network_id}" + name = "${var.server_name}-eth1" + network_id = "${module.nat.network_id}" + fixed_ip { subnet_id = "${openstack_networking_subnet_v2.subnet_2.id}" } @@ -108,4 +110,4 @@ module "floatingip" { resource "openstack_networking_floatingip_associate_v2" "association_1" { port_id = "${openstack_networking_port_v2.port_1.id}" floating_ip = "${module.floatingip.floatingip_address}" -} \ No newline at end of file +} diff --git a/modules/vpc/server_remote_root_disk_two_ports/vars.tf b/modules/vpc/server_remote_root_disk_two_ports/vars.tf index f8e7683..9b94aef 100644 --- a/modules/vpc/server_remote_root_disk_two_ports/vars.tf +++ b/modules/vpc/server_remote_root_disk_two_ports/vars.tf @@ -38,4 +38,4 @@ variable "server_zone" { variable "server_ssh_key" {} -variable "server_ssh_key_user" {} \ No newline at end of file +variable "server_ssh_key_user" {} diff --git a/modules/vpc/subnet/vars.tf b/modules/vpc/subnet/vars.tf index b87e9af..a0f4a1c 100644 --- a/modules/vpc/subnet/vars.tf +++ b/modules/vpc/subnet/vars.tf @@ -3,9 +3,9 @@ variable "subnet_project_id" {} variable "subnet_region" {} variable "subnet_prefix_length" { - default = 29 + default = 29 } variable "subnet_ip_version" { - default = "ipv4" + default = "ipv4" }