mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(tf): prox
This commit is contained in:
parent
69a47e6734
commit
196dc999db
16 changed files with 288 additions and 9 deletions
|
|
@ -36,3 +36,84 @@ provider "proxmox" {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
data "proxmox_virtual_environment_role" "vm_admin" {
|
||||
role_id = "PVEVMAdmin"
|
||||
}
|
||||
|
||||
data "proxmox_virtual_environment_role" "administrator" {
|
||||
role_id = "Administrator"
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_group" "admin" {
|
||||
group_id = "admin"
|
||||
comment = "System Administrators"
|
||||
|
||||
acl {
|
||||
path = "/"
|
||||
propagate = true
|
||||
role_id = data.proxmox_virtual_environment_role.administrator.id
|
||||
}
|
||||
}
|
||||
|
||||
resource "random_password" "proxmox_initial" {
|
||||
length = 32
|
||||
special = false
|
||||
}
|
||||
|
||||
variable "proxmox_user_arc_email" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "proxmox_user_arc_first_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "proxmox_user_arc_last_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_user" "arc" {
|
||||
user_id = "arc@pve"
|
||||
email = var.proxmox_user_arc_email
|
||||
first_name = var.proxmox_user_arc_first_name
|
||||
last_name = var.proxmox_user_arc_last_name
|
||||
password = random_password.proxmox_initial.result
|
||||
groups = [proxmox_virtual_environment_group.admin.id]
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [password]
|
||||
}
|
||||
}
|
||||
|
||||
variable "proxmox_user_kat_email" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_user" "kat" {
|
||||
user_id = "kat@pve"
|
||||
email = var.proxmox_user_kat_email
|
||||
first_name = "Kat"
|
||||
last_name = "Inskip"
|
||||
password = random_password.proxmox_initial.result
|
||||
groups = [proxmox_virtual_environment_group.admin.id]
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [password]
|
||||
}
|
||||
}
|
||||
|
||||
variable "proxmox_user_liz_last_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_user" "liz" {
|
||||
user_id = "liz@pve"
|
||||
first_name = "Elizabeth"
|
||||
last_name = var.proxmox_user_liz_last_name
|
||||
password = random_password.proxmox_initial.result
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [password]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue