From 32004c9a7859711aaa81af8caf8a1eee5b142533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Limpinho?= <53994778+TomasLimpinho@users.noreply.github.com> Date: Tue, 19 Aug 2025 11:36:54 +0100 Subject: [PATCH] vaultwarden password and proxmox --- main.tf | 4 ++++ proxmox.tf | 3 +++ proxmox.variables.tf | 5 +++++ secrets/proxmox.secrets.tfvars | 5 +++++ vaultwarden.tf | 16 ++++++++++++++++ 5 files changed, 33 insertions(+) create mode 100644 proxmox.tf create mode 100644 proxmox.variables.tf create mode 100644 secrets/proxmox.secrets.tfvars diff --git a/main.tf b/main.tf index e32fcc7..ce0e2ad 100644 --- a/main.tf +++ b/main.tf @@ -7,6 +7,10 @@ terraform { vaultwarden = { source = "ottramst/vaultwarden" version = "0.4.4" + } + proxmox = { + source = "telmate/proxmox" + version = "3.0.2-rc03" } } backend "consul" { diff --git a/proxmox.tf b/proxmox.tf new file mode 100644 index 0000000..f699085 --- /dev/null +++ b/proxmox.tf @@ -0,0 +1,3 @@ +provider "proxmox" { + pm_api_url = var.proxmox_server +} \ No newline at end of file diff --git a/proxmox.variables.tf b/proxmox.variables.tf new file mode 100644 index 0000000..e84224a --- /dev/null +++ b/proxmox.variables.tf @@ -0,0 +1,5 @@ +variable "proxmox_server" { + description = "Proxmox server URL" + type = string + sensitive = false +} diff --git a/secrets/proxmox.secrets.tfvars b/secrets/proxmox.secrets.tfvars new file mode 100644 index 0000000..2ec36a5 --- /dev/null +++ b/secrets/proxmox.secrets.tfvars @@ -0,0 +1,5 @@ +proxmox_server = "proxmox.example.com" +PM_API_TOKEN_ID = "tokenid" +PM_API_TOKEN_SECRET = "tokensecret" +# tokenid is read automatically from PM_API_TOKEN_ID +# token is read automatically from PM_API_TOKEN_SECRET \ No newline at end of file diff --git a/vaultwarden.tf b/vaultwarden.tf index 70f55db..0018ced 100644 --- a/vaultwarden.tf +++ b/vaultwarden.tf @@ -9,4 +9,20 @@ resource "vaultwarden_account_register" "vaultwarden-acount-fenix" { name = "fenix" email = var.vaultwarden_email password = var.vaultwarden_master_password +} + +resource "vaultwarden_organization" "vaultwarden-organization-fenix-iac" { + name = "fenix-iac" +} + +resource "vaultwarden_organization_collection" "vaultwarden-collection-iac" { + organization_id = vaultwarden_organization.vaultwarden-organization-fenix-iac.id + name = "iac-collection" +} + + +resource "vaultwarden_item_login" "service_password" { + name = "MyService Password" + username = "serviceuser" + password = "aaaaaaa" } \ No newline at end of file