From 6c5225bf67168c319de3db9e5e1f29d239c5cf5a Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Sat, 14 Sep 2024 12:07:13 -0500 Subject: [PATCH] Add network.tf --- network.tf | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 network.tf diff --git a/network.tf b/network.tf new file mode 100644 index 0000000..522df76 --- /dev/null +++ b/network.tf @@ -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 +} \ No newline at end of file