Agregando configuración de home assistant
This commit is contained in:
58
proxmox/homeassistant/main.tf
Normal file
58
proxmox/homeassistant/main.tf
Normal file
@@ -0,0 +1,58 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "bpg/proxmox"
|
||||
version = "0.86.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data "local_file" "proxmox_ssh_private_key" {
|
||||
filename = var.proxmox_ssh_privkey_path
|
||||
}
|
||||
|
||||
provider "proxmox" {
|
||||
endpoint = var.proxmox_endpoint
|
||||
username = var.proxmox_user
|
||||
password = var.proxmox_password
|
||||
insecure = true
|
||||
|
||||
ssh {
|
||||
agent = true
|
||||
username = var.proxmox_ssh_username
|
||||
private_key = trimspace(data.local_file.proxmox_ssh_private_key.content)
|
||||
}
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_vm" "homeassistant" {
|
||||
name = "homeassistant"
|
||||
node_name = var.proxmox_node
|
||||
|
||||
stop_on_destroy = true
|
||||
|
||||
bios = "ovmf"
|
||||
|
||||
cpu {
|
||||
cores = 2
|
||||
type = "host"
|
||||
}
|
||||
|
||||
memory {
|
||||
dedicated = 8096
|
||||
}
|
||||
|
||||
efi_disk {
|
||||
datastore_id = var.vm_datastore
|
||||
}
|
||||
|
||||
disk {
|
||||
datastore_id = var.vm_datastore
|
||||
import_from = "${var.proxmox_datastore}:import/haos_ova-16.3.qcow2"
|
||||
interface = "virtio0"
|
||||
size = 100
|
||||
}
|
||||
|
||||
network_device {
|
||||
bridge = var.bridge
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user