-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Модуль network; добавление двух локальных сетей в модуль vm (#2)
* init * removed temp examples folder; added a new network module representing a local network with no internet connection; change vm module to include two local networks and two methods of attaching ports to a vm * changed mks nat to have a gateway by default; updated vm ports to fix vm creation error; updated vm outputs to not include temp outputs * fmt fixes --------- Co-authored-by: orlov-a <orlov.aa@selectel.com>
- Loading branch information
Showing
11 changed files
with
127 additions
and
2 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
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 |
---|---|---|
|
@@ -160,3 +160,8 @@ variable "gpu_ng_taints" { | |
})) | ||
default = [] | ||
} | ||
|
||
variable "no_gateway" { | ||
type = string | ||
default = false | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
resource "openstack_networking_network_v2" "network_1" { | ||
name = var.network_name | ||
} | ||
|
||
resource "openstack_networking_subnet_v2" "subnet_1" { | ||
network_id = openstack_networking_network_v2.network_1.id | ||
name = var.subnet_cidr | ||
cidr = var.subnet_cidr | ||
enable_dhcp = var.enable_dhcp | ||
no_gateway = var.no_gateway | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "network_id" { | ||
value = openstack_networking_network_v2.network_1.id | ||
} | ||
|
||
output "subnet_id" { | ||
value = openstack_networking_subnet_v2.subnet_1.id | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
variable "network_name" { | ||
default = "network_1" | ||
} | ||
|
||
variable "subnet_cidr" { | ||
default = "192.168.0.0/24" | ||
} | ||
|
||
variable "enable_dhcp" { | ||
default = false | ||
} | ||
|
||
variable "no_gateway" { | ||
default = true | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_providers { | ||
openstack = { | ||
source = "terraform-provider-openstack/openstack" | ||
version = "1.53.0" | ||
} | ||
} | ||
required_version = ">= 1.5.0" | ||
} |
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
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ output "nat_sub_id" { | |
|
||
output "vm_port_id" { | ||
value = openstack_networking_port_v2.port_1.id | ||
} | ||
} |
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