summaryrefslogtreecommitdiff
path: root/terraform/main.tf
diff options
context:
space:
mode:
Diffstat (limited to 'terraform/main.tf')
-rw-r--r--terraform/main.tf105
1 files changed, 19 insertions, 86 deletions
diff --git a/terraform/main.tf b/terraform/main.tf
index 9977fb4..fc10416 100644
--- a/terraform/main.tf
+++ b/terraform/main.tf
@@ -1,89 +1,22 @@
-# Provider
-terraform {
- required_providers {
- proxmox = {
- source = "bpg/proxmox"
- version = "~> 0.83"
- }
- }
+# module "vyos" {
+# source = "./modules/vyos"
+# node_name = var.node_name
+# vm_id = 201
+# memory = 2048
+# }
+
+module "eveng" {
+ source = "./modules/eveng"
+ node_name = var.node_name
+ vm_id = 202
+ memory_dedicated = 8192
+ cpu_cores = 4
}
-provider "proxmox" {
- endpoint = var.proxmox_endpoint
- api_token = var.proxmox_api_token
-
- insecure = true
-}
-
-
-# LXC Container
-
-resource "proxmox_virtual_environment_container" "lxc01" {
-
- vm_id = var.lxc_id
- node_name = var.node_name
-
-
- started = true
-
- wait_for_ip {
- ipv4 = true
- }
-
- operating_system {
- template_file_id = "local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
- }
-
-
- cpu {
- cores = var.lxc_cores
- }
-
- memory {
- dedicated = var.lxc_memory
- swap = 512
- }
-
- disk {
- datastore_id = "local-lvm"
- size = 8
- }
-
- network_interface {
- name = "eth0"
- bridge = "vmbr0"
-
- }
-
- initialization {
- hostname = var.lxc_name
-
- ip_config {
- ipv4 {
- address = "dhcp"
- }
- }
-
- user_account {
- keys = [
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHB4jD3PVsg1edlMwBW6Hb/NYLnzEI8dyJQRnQQap45q enrico@cachyos"
- ]
- }
- }
-}
-
-
-resource "local_file" "ansible_inventory" {
- content = <<-EOT
- [lxc]
- ${try(proxmox_virtual_environment_container.lxc01.ipv4["eth0"], "Brak_IP")} ansible_user=root ansible_ssh_common_args='-o StrictHostKeyChecking=no'
- EOT
-
- filename = "${path.module}/../ansible/inventory.ini"
-}
-
-output "aktualne_ip_kontenera" {
- description = "Adres IP pobrany przez Terraforma"
- value = try(proxmox_virtual_environment_container.lxc01.ipv4["eth0"], "Proxmox jeszcze nie zaraportowaƂ IP!")
-}
+# module "observability_stack" {
+# source = "./modules/observability"
+# node_name = var.node_name
+# lxc_id = 203
+# network_bridge = "vmbr0"
+# }