Add network.tf

This commit is contained in:
Matthew Fisher 2024-09-14 12:07:13 -05:00
commit 6c5225bf67

117
network.tf Normal file
View File

@ -0,0 +1,117 @@
# Instruct terraform to download the provider on `terraform init`
terraform {
required_providers {
xenorchestra = {
source = "terra-farm/xenorchestra"
}
}
}
# Configure the XenServer Provider
provider "xenorchestra" {
# Must be ws or wss
url = "wss://xoa.lan.fisherhome.xyz" # Or set XOA_URL environment variable
username = "admin"
password = "Forever17676"
# This is false by default and
# will disable ssl verification if true.
# This is useful if your deployment uses
# a self signed certificate but should be
# used sparingly!
insecure = true # Or set XOA_INSECURE environment variable to any value
}
data "xenorchestra_pool" "prod-t1" {
name_label = "prod-t1-xcp"
}
data "xenorchestra_hosts" "prod-t1" {
pool_id = data.xenorchestra_pool.prod-t1.id
sort_by = "name_label"
sort_order = "asc"
}
data "xenorchestra_pool" "prod-t2" {
name_label = "prod-t2-xcp"
}
data "xenorchestra_hosts" "prod-t2" {
pool_id = data.xenorchestra_pool.prod-t2.id
sort_by = "name_label"
sort_order = "asc"
}
#resource "xenorchestra_network" "T1_PROD_VLAN" {
# name_label = "PROD"
# pool_id = data.xenorchestra_hosts.prod-t1.pool_id
# source_pif_device = "eth0"
# vlan = 100
#}
resource "xenorchestra_network" "T2_PROD_VLAN" {
name_label = "PROD"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 100
}
resource "xenorchestra_network" "T2_WIN_VLAN" {
name_label = "WIN_NET"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 101
}
resource "xenorchestra_network" "PUBLIC_VLAN" {
name_label = "PUBLIC"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 71
}
resource "xenorchestra_network" "QA_VLAN" {
name_label = "QA"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 108
}
resource "xenorchestra_network" "DEV_VLAN" {
name_label = "DEV"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 107
}
resource "xenorchestra_network" "TEST-KUBE_VLAN" {
name_label = "TEST-KUBERNETES"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 140
}
resource "xenorchestra_network" "PROD-KUBE_VLAN" {
name_label = "PROD-KUBERNETES"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 142
}
resource "xenorchestra_network" "STORAGE_VLAN" {
name_label = "PROD-STORAGE"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 95
}
resource "xenorchestra_network" "CLOUDSTACK_MGMT_VLAN" {
name_label = "PROD-CLOUDSTACK-MGMT"
pool_id = data.xenorchestra_hosts.prod-t2.pool_id
source_pif_device = "eth0"
vlan = 2002
}