nas.tf as clone
This commit is contained in:
99
nas.tf
99
nas.tf
@@ -1,48 +1,3 @@
|
|||||||
# ---
|
|
||||||
# Create a new VM
|
|
||||||
|
|
||||||
resource "proxmox_cloud_init_disk" "ci" {
|
|
||||||
name = local.vm_name
|
|
||||||
pve_node = local.pve_node
|
|
||||||
storage = local.iso_storage_pool
|
|
||||||
|
|
||||||
meta_data = yamlencode({
|
|
||||||
instance_id = sha1(local.vm_name)
|
|
||||||
local-hostname = local.vm_name
|
|
||||||
})
|
|
||||||
|
|
||||||
user_data = <<-EOT
|
|
||||||
#cloud-config
|
|
||||||
users:
|
|
||||||
- root
|
|
||||||
ssh_authorized_keys:
|
|
||||||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINFw70PrMsilcsqCrwW1I6PAt3anQbhmVg+t/HUfomug ryan@mxDesktop
|
|
||||||
EOT
|
|
||||||
|
|
||||||
network_config = yamlencode({
|
|
||||||
version = 1
|
|
||||||
config = [{
|
|
||||||
type = "physical"
|
|
||||||
name = "eth0"
|
|
||||||
subnets = [{
|
|
||||||
type = "static"
|
|
||||||
address = "192.168.0.50/24"
|
|
||||||
gateway = "192.168.0.1"
|
|
||||||
dns_nameservers = [
|
|
||||||
#"seconddns",
|
|
||||||
"192.168.0.24"
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
locals {
|
|
||||||
vm_name = "nas"
|
|
||||||
pve_node = "ryuk"
|
|
||||||
iso_storage_pool = "cephfs"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "proxmox_vm_qemu" "nas" {
|
resource "proxmox_vm_qemu" "nas" {
|
||||||
|
|
||||||
# VM General Settings
|
# VM General Settings
|
||||||
@@ -55,10 +10,10 @@ resource "proxmox_vm_qemu" "nas" {
|
|||||||
onboot = true
|
onboot = true
|
||||||
|
|
||||||
# VM OS Settings
|
# VM OS Settings
|
||||||
# clone = "your-clone"
|
clone = "Debian12Template"
|
||||||
|
|
||||||
# VM System Settings
|
# VM System Settings
|
||||||
# agent = 1
|
# agent = 1
|
||||||
|
|
||||||
# VM CPU Settings
|
# VM CPU Settings
|
||||||
cores = 6
|
cores = 6
|
||||||
@@ -74,57 +29,17 @@ resource "proxmox_vm_qemu" "nas" {
|
|||||||
model = "virtio"
|
model = "virtio"
|
||||||
}
|
}
|
||||||
|
|
||||||
disks {
|
|
||||||
ide {
|
|
||||||
ide0 {
|
|
||||||
cdrom {
|
|
||||||
iso = "cephfs:iso/debian-12.9.0-amd64-netinst.iso"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
virtio {
|
|
||||||
#virtio2 {
|
|
||||||
# cdrom {
|
|
||||||
# iso = "cephfs:iso/debian-12.9.0-amd64-netinst.iso"
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
virtio0 {
|
|
||||||
#root disk
|
|
||||||
disk{
|
|
||||||
asyncio = "native"
|
|
||||||
discard = "true"
|
|
||||||
iothread = "true"
|
|
||||||
size = "140G"
|
|
||||||
storage = "local-lvm"
|
|
||||||
format = "raw"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
virtio1 {
|
|
||||||
#bulk disk
|
|
||||||
disk {
|
|
||||||
asyncio = "native"
|
|
||||||
backup = "false"
|
|
||||||
iothread = "true"
|
|
||||||
size = "8T"
|
|
||||||
storage = "local-lvm"
|
|
||||||
format = "raw"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# VM Cloud-Init Settings
|
# VM Cloud-Init Settings
|
||||||
os_type = "cloud-init"
|
os_type = "cloud-init"
|
||||||
|
|
||||||
# (Optional) IP Address and Gateway
|
# (Optional) IP Address and Gateway
|
||||||
#ipconfig0 = "ip=192.168.0.50/24,gw=192.168.0.1"
|
ipconfig0 = "ip=192.168.0.50/24,gw=192.168.0.1"
|
||||||
|
|
||||||
# (Optional) Default User
|
# (Optional) Default User
|
||||||
# ciuser = "your-username"
|
ciuser = "root"
|
||||||
|
|
||||||
# (Optional) Add your SSH KEY
|
# (Optional) Add your SSH KEY
|
||||||
#sshkeys = <<EOF
|
sshkeys = <<EOF
|
||||||
#ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINFw70PrMsilcsqCrwW1I6PAt3anQbhmVg+t/HUfomug ryan@mxDesktop
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINFw70PrMsilcsqCrwW1I6PAt3anQbhmVg+t/HUfomug ryan@mxDesktop
|
||||||
#EOF
|
EOF
|
||||||
}
|
}
|
||||||
@@ -7,10 +7,6 @@
|
|||||||
vars:
|
vars:
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
#- name: Setup PVE node for transcoding and vpn
|
|
||||||
# ansible.builtin.command: /usr/bin/ansible-playbook ./roles/ind/grail/set-pvenode.yml -k
|
|
||||||
# delegate_to: 127.0.0.1
|
|
||||||
|
|
||||||
- name: Upgrade-packages.yml - update packages
|
- name: Upgrade-packages.yml - update packages
|
||||||
include: ../../lib/upgrade-packages.yml
|
include: ../../lib/upgrade-packages.yml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user