60 lines
1.6 KiB
Terraform
60 lines
1.6 KiB
Terraform
|
terraform {
|
||
|
required_providers {
|
||
|
proxmox = {
|
||
|
source = "bpg/proxmox"
|
||
|
version = "~>0.56.1"
|
||
|
}
|
||
|
}
|
||
|
required_version = ">=1.6.2"
|
||
|
}
|
||
|
|
||
|
provider "proxmox" {
|
||
|
endpoint = var.pve_api_base_url
|
||
|
api_token = var.pve_api_token
|
||
|
}
|
||
|
|
||
|
module "netboot_server" {
|
||
|
source = "./modules/netboot_server"
|
||
|
hostname = "netboot_server"
|
||
|
prod_network_name = var.admin_network_name
|
||
|
dhcp_iface = "ens18"
|
||
|
dhcp_server_ip_addr = cidrhost(var.admin_network_prefix, 2)
|
||
|
dhcp_gateway = cidrhost(var.admin_network_prefix, 1)
|
||
|
dhcp_range = var.admin_network_prefix
|
||
|
ssh_public_key_opentofu_netboot_server = var.ssh_public_key_opentofu_netboot_server
|
||
|
|
||
|
pve_api_base_url = var.pve_api_base_url
|
||
|
pve_api_token = var.pve_api_token
|
||
|
pve_node_name = var.pve_node_name
|
||
|
pve_storage_id = var.pve_storage_id
|
||
|
pve_vm_id = 108
|
||
|
}
|
||
|
|
||
|
module "poc" {
|
||
|
depends_on = [ module.netboot_server ]
|
||
|
source = "./modules/poc"
|
||
|
pve_vm_id = 110
|
||
|
pve_storage_id = "local"
|
||
|
pve_node_name = "ns3152888"
|
||
|
pve_ssh_user = var.pve_ssh_user
|
||
|
pve_ssh_host = var.pve_ssh_host
|
||
|
netboot_server_ip_address = cidrhost(var.admin_network_prefix, 2)
|
||
|
|
||
|
admin_network = {
|
||
|
name = var.admin_network_name
|
||
|
prefix = var.admin_network_prefix
|
||
|
mac_address = "1c:69:7a:ff:ff:01"
|
||
|
}
|
||
|
prod_network = {
|
||
|
name = var.prod_network_name
|
||
|
prefix = var.prod_network_prefix
|
||
|
mac_address = "1c:69:7a:ef:ff:01"
|
||
|
}
|
||
|
monitoring_network = {
|
||
|
name = var.monit_network_name
|
||
|
prefix = var.monit_network_prefix
|
||
|
mac_address = "1c:69:7a:df:ff:01"
|
||
|
}
|
||
|
admin_ssh_public_key = var.ssh_public_key_admin_netboot_server
|
||
|
}
|