Compare commits

..

11 Commits

Author SHA1 Message Date
b3afe77bc0 output name and id to file 2025-10-18 20:29:22 +00:00
ef8ad56273 output test basic 2025-10-18 15:15:31 -04:00
344cb8a398 fixing console 2025-10-18 13:01:44 -04:00
d2ba0f5b9a Working? 2025-10-18 12:53:10 -04:00
440cd09734 attempt idk a lot 2025-10-18 12:08:50 -04:00
92e773faf4 Help me I am drowning 2025-10-18 12:07:59 -04:00
da522ad02e testing local container 2025-10-18 12:06:42 -04:00
768b778c69 Fixed Volume ID 2025-10-18 11:01:56 -04:00
d534503c54 Testing First Deployment 2025-10-18 10:48:44 -04:00
ac3a7b5681 Fix var 2025-10-18 10:11:31 -04:00
843de2f9a2 Attempt 2 lol 2025-10-18 10:10:33 -04:00
5 changed files with 50 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ https://github.com/Telmate/terraform-provider-proxmox/blob/master/docs/index.md
pveum role add TerraformProv -privs "Datastore.AllocateSpace Datastore.AllocateTemplate Datastore.Audit Pool.Allocate Sys.Audit Sys.Console Sys.Modify VM.Allocate VM.Audit VM.Clone VM.Config.CDROM VM.Config.Cloudinit VM.Config.CPU VM.Config.Disk VM.Config.HWType VM.Config.Memory VM.Config.Network VM.Config.Options VM.Monitor VM.Migrate VM.PowerMgmt SDN.Use" pveum role add TerraformProv -privs "Datastore.AllocateSpace Datastore.AllocateTemplate Datastore.Audit Pool.Allocate Sys.Audit Sys.Console Sys.Modify VM.Allocate VM.Audit VM.Clone VM.Config.CDROM VM.Config.Cloudinit VM.Config.CPU VM.Config.Disk VM.Config.HWType VM.Config.Memory VM.Config.Network VM.Config.Options VM.Monitor VM.Migrate VM.PowerMgmt SDN.Use"
pveum user add terraform-prov@pve --password <in 1password> pveum user add terraform-prov@pve --password <in 1password>
pveum aclmod / -user terraform-prov@pve -role TerraformProv pveum aclmod / -user terraform-prov@pve -role TerraformProv
pveum user token add terraform-prov@pve terraform-token --expire $(date -d 2025-10-24T23:59:59 +%s) pveum user token add terraform-prov@pve terraform-token --expire $(date -d 2025-10-24T23:59:59 +%s) --privsep false
#Nice this worked #Nice this worked
# if update to 9 later # if update to 9 later
@@ -25,3 +25,8 @@ pveum role list
pveum role delete <uid> pveum role delete <uid>
pveum user delete <uid> pveum user delete <uid>
#I had to set the mapall user : root and mapall group : wheel in truenas. but then it worked!
pvesm path "nfs_Vulnerable:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst"

1
homelab_pub Normal file
View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJo337iE4+Ry7T65Ey+2QQ9aRaGxP7zzLtMV+hBPyA59 eddsa-key-20250525

4
outputs.tf Normal file
View File

@@ -0,0 +1,4 @@
output "proxmox" {
description="I am doing my Best"
value = basic.id
}

View File

@@ -3,7 +3,10 @@ terraform {
required_providers{ required_providers{
proxmox = { proxmox = {
source = "/telmate/proxmox" source = "telmate/proxmox"
}
ansible = {
source = "ansible/ansible"
} }
} }
} }
@@ -23,5 +26,5 @@ variable "proxmox_api_token_secret" {
provider "proxmox" { provider "proxmox" {
pm_api_url = var.proxmox_api_url pm_api_url = var.proxmox_api_url
pm_api_token_id = var.proxmox_api_token_id pm_api_token_id = var.proxmox_api_token_id
pm_api_token_secret = var proxmox_api_token_secret pm_api_token_secret = var.proxmox_api_token_secret
} }

33
srv-debianlxc.tf Normal file
View File

@@ -0,0 +1,33 @@
resource "proxmox_lxc" "basic" {
target_node = "pve"
hostname = "lxc-basic"
ostemplate = "nfs_Vulnerable:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst"
password = "BasicLXCContainer"
unprivileged = true
description = "Nice"
features {
nesting = true
}
ssh_public_keys = <<-EOT
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJo337iE4+Ry7T65Ey+2QQ9aRaGxP7zzLtMV+hBPyA59 eddsa-key-20250525
EOT
// Terraform will crash without rootfs defined
rootfs {
storage = "nfs_Protected"
size = "8G"
}
network {
name = "eth0"
bridge = "vmbr0"
ip = "dhcp"
}
}
resource "local_file" "Ans_inv" {
content = <<-DOC
hostname: ${proxmox_lxc.basic.hostname}
id: ${proxmox_lxc.basic.id}
DOC
filename = "${path.module}/output.txt"
}