- New template had to be based on a CIFS file system to be referencable across hosts - high-sea is new VM for *arr hosting.master
parent
06615390aa
commit
869a1272a6
@ -0,0 +1,50 @@
|
|||||||
|
provider "proxmox" {
|
||||||
|
# url is the hostname (FQDN if you have one) for the proxmox host you'd like to connect to to issue the commands.
|
||||||
|
pm_api_url = "https://192.168.1.230:8006/api2/json"
|
||||||
|
pm_api_token_id = var.PM_API_TOKEN_ID
|
||||||
|
pm_api_token_secret = var.PM_API_TOKEN_SECRET
|
||||||
|
pm_tls_insecure = true
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "proxmox_vm_qemu" "high-sea" {
|
||||||
|
name = "high-sea"
|
||||||
|
target_node = var.high-sea-host
|
||||||
|
clone = var.template_name
|
||||||
|
# basic VM settings here. agent refers to guest agent
|
||||||
|
agent = 1
|
||||||
|
os_type = "debian"
|
||||||
|
cores = 2
|
||||||
|
sockets = 1
|
||||||
|
cpu = "host"
|
||||||
|
memory = 4096
|
||||||
|
scsihw = "virtio-scsi-pci"
|
||||||
|
bootdisk = "scsi0"
|
||||||
|
disk {
|
||||||
|
slot = 0
|
||||||
|
# set disk size here. leave it small for testing because expanding the disk takes time.
|
||||||
|
size = "20G"
|
||||||
|
type = "scsi"
|
||||||
|
storage = "sainthood-cifs"
|
||||||
|
iothread = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# if you want two NICs, just copy this whole network section and duplicate it
|
||||||
|
network {
|
||||||
|
model = "virtio"
|
||||||
|
bridge = "vmbr0"
|
||||||
|
}
|
||||||
|
# not sure exactly what this is for. presumably something about MAC addresses and ignore network changes during the life of the VM
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
network,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
ipconfig0 = "ip=10.10.1.10/24,gw=10.98.1.1"
|
||||||
|
|
||||||
|
# sshkeys set using variables. the variable contains the text of the key.
|
||||||
|
}
|
||||||
|
|
||||||
|
# Configure DO DNS after VM is build. A record to point to machine?
|
||||||
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
proxmox = {
|
||||||
|
source = "telmate/proxmox"
|
||||||
|
version = "2.7.4"
|
||||||
|
}
|
||||||
|
digitalocean = {
|
||||||
|
source = "digitalocean/digitalocean"
|
||||||
|
version = "~> 2.29.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
backend "s3" {
|
||||||
|
key = "bikeshed/terraform.tfstate"
|
||||||
|
bucket = "deploy-state"
|
||||||
|
region = "us-west-2"
|
||||||
|
endpoint = "https://sfo2.digitaloceanspaces.com"
|
||||||
|
skip_region_validation = true
|
||||||
|
skip_credentials_validation = true
|
||||||
|
skip_metadata_api_check = true
|
||||||
|
|
||||||
|
# This is actually not needed, but declaring it here helps me remember where its supposed to live.
|
||||||
|
# You gotta comment these out when initing the terraform backend? for some reason.
|
||||||
|
shared_credentials_files = ["~/.aws/credentials"]
|
||||||
|
shared_config_files = ["~/.aws/config"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
provider "digitalocean" {
|
||||||
|
token = var.DO_PAT
|
||||||
|
}
|
Loading…
Reference in new issue