Skip to content
Snippets Groups Projects
Commit 1967eaba authored by František Dvořák's avatar František Dvořák
Browse files

Terraform: build local network at PSNC

parent e655386b
No related branches found
No related tags found
No related merge requests found
# These need to be defined for things to work # These need to be defined for things to work
ip_pool = "PSNC-PUB1-EDU" ip_pool = "PSNC-PUB1-EDU"
net_name = "local-network"
site_name = "staging" site_name = "staging"
# These may need some adjustment for your provider # These may need some adjustment for your provider
......
...@@ -3,11 +3,6 @@ variable "ip_pool" { ...@@ -3,11 +3,6 @@ variable "ip_pool" {
description = "The name of the public IP pool for the servers" description = "The name of the public IP pool for the servers"
} }
variable "net_name" {
type = string
description = "The name of the IPv4 network"
}
variable "site_name" { variable "site_name" {
type = string type = string
description = "Site identifier for internal host names" description = "Site identifier for internal host names"
......
provider "openstack" {
}
terraform { terraform {
required_providers { required_providers {
local = "~> 2.0" local = "~> 2.0"
......
provider "openstack" {
}
locals { locals {
nodes = concat([ nodes = concat([
openstack_compute_instance_v2.ingress, openstack_compute_instance_v2.ingress,
...@@ -130,7 +127,7 @@ resource "openstack_compute_instance_v2" "master" { ...@@ -130,7 +127,7 @@ resource "openstack_compute_instance_v2" "master" {
user_data = file("cloud-init.yaml") user_data = file("cloud-init.yaml")
tags = ["master"] tags = ["master"]
network { network {
name = var.net_name uuid = openstack_networking_network_v2.local-network.id
} }
} }
...@@ -142,7 +139,7 @@ resource "openstack_compute_instance_v2" "nfs" { ...@@ -142,7 +139,7 @@ resource "openstack_compute_instance_v2" "nfs" {
user_data = file("cloud-init.yaml") user_data = file("cloud-init.yaml")
tags = ["worker"] tags = ["worker"]
network { network {
name = var.net_name uuid = openstack_networking_network_v2.local-network.id
} }
} }
...@@ -154,7 +151,7 @@ resource "openstack_compute_instance_v2" "ingress" { ...@@ -154,7 +151,7 @@ resource "openstack_compute_instance_v2" "ingress" {
user_data = file("cloud-init.yaml") user_data = file("cloud-init.yaml")
tags = ["worker"] tags = ["worker"]
network { network {
name = var.net_name uuid = openstack_networking_network_v2.local-network.id
} }
} }
...@@ -167,7 +164,7 @@ resource "openstack_compute_instance_v2" "worker" { ...@@ -167,7 +164,7 @@ resource "openstack_compute_instance_v2" "worker" {
user_data = file("cloud-init.yaml") user_data = file("cloud-init.yaml")
tags = ["worker"] tags = ["worker"]
network { network {
name = var.net_name uuid = openstack_networking_network_v2.local-network.id
} }
} }
...@@ -180,7 +177,7 @@ resource "openstack_compute_instance_v2" "gpu" { ...@@ -180,7 +177,7 @@ resource "openstack_compute_instance_v2" "gpu" {
user_data = file("cloud-init.yaml") user_data = file("cloud-init.yaml")
tags = ["worker"] tags = ["worker"]
network { network {
name = var.net_name uuid = openstack_networking_network_v2.local-network.id
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment