commit 6c5225bf67168c319de3db9e5e1f29d239c5cf5a Author: Matthew Fisher Date: Sat Sep 14 12:07:13 2024 -0500 Add 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