Compare commits
2 Commits
a6662b7b4a
...
ec79acd448
| Author | SHA1 | Date | |
|---|---|---|---|
| ec79acd448 | |||
| e824649729 |
27
Notes.txt
Normal file
27
Notes.txt
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#Hey Friends
|
||||||
|
# Starting with installing terraform on my ansible box.
|
||||||
|
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
||||||
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
|
||||||
|
sudo apt update && sudo apt install terraform
|
||||||
|
|
||||||
|
# I dont want this to be in bash. but oh well
|
||||||
|
|
||||||
|
#starting with this github
|
||||||
|
https://github.com/Telmate/terraform-provider-proxmox/blob/master/docs/index.md
|
||||||
|
|
||||||
|
#I am on Proxmox 8 so starting off there.
|
||||||
|
|
||||||
|
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 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)
|
||||||
|
#Nice this worked
|
||||||
|
|
||||||
|
# if update to 9 later
|
||||||
|
pveum role modify 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.Migrate VM.PowerMgmt SDN.Use"
|
||||||
|
|
||||||
|
#If I hate this
|
||||||
|
pveum role list
|
||||||
|
pveum role delete <uid>
|
||||||
|
pveum user delete <uid>
|
||||||
|
|
||||||
27
provider.tf
Normal file
27
provider.tf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
terraform {
|
||||||
|
required_version = ">= 1.13.0"
|
||||||
|
|
||||||
|
required_providers{
|
||||||
|
proxmox = {
|
||||||
|
source = "/telmate/proxmox"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "proxmox_api_url" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
variable "proxmox_api_token_id" {
|
||||||
|
type = string
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
|
variable "proxmox_api_token_secret" {
|
||||||
|
type = string
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "proxmox" {
|
||||||
|
pm_api_url = var.proxmox_api_url
|
||||||
|
pm_api_token_id = var.proxmox_api_token_id
|
||||||
|
pm_api_token_secret = var proxmox_api_token_secret
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user