stage #19
@@ -1,7 +1,5 @@
|
|||||||
### Global cloud-init template (for all VMs)
|
|
||||||
|
|
||||||
data "template_file" "cloud_init_global" {
|
data "template_file" "cloud_init_global" {
|
||||||
template = file("${path.module}/files/cloud_init_global.yaml")
|
template = file("${path.module}/files/cloud_init_global.tpl")
|
||||||
|
|
||||||
vars = {
|
vars = {
|
||||||
hostname = "generic"
|
hostname = "generic"
|
||||||
@@ -13,5 +11,5 @@ data "template_file" "cloud_init_global" {
|
|||||||
|
|
||||||
resource "local_file" "cloud_init_global" {
|
resource "local_file" "cloud_init_global" {
|
||||||
content = data.template_file.cloud_init_global.rendered
|
content = data.template_file.cloud_init_global.rendered
|
||||||
filename = "${path.module}/files/cloud_init_global.yaml"
|
filename = "${path.module}/files/rendered/cloud_init_global.yaml"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#cloud-config
|
#cloud-config
|
||||||
#cloud-config
|
hostname: ${hostname}
|
||||||
hostname: myvm
|
|
||||||
manage_etc_hosts: true
|
manage_etc_hosts: true
|
||||||
resolv_conf:
|
resolv_conf:
|
||||||
nameservers:
|
nameservers:
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
output "alpaca_vm_ids" {
|
output "alpaca_vm_ids" {
|
||||||
value = {
|
value = {
|
||||||
for i in range(var.alpaca_count) :
|
for i in range(var.alpaca_vm_count) :
|
||||||
"alpaca-${i + 1}" => proxmox_vm_qemu.alpacas[i].vmid
|
"alpaca-${i + 1}" => proxmox_vm_qemu.alpacas[i].vmid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ output "alpaca_vm_names" {
|
|||||||
|
|
||||||
output "llama_vm_ids" {
|
output "llama_vm_ids" {
|
||||||
value = {
|
value = {
|
||||||
for i in range(var.llama_count) :
|
for i in range(var.llama_vm_count) :
|
||||||
"llama-${i + 1}" => proxmox_vm_qemu.llamas[i].vmid
|
"llama-${i + 1}" => proxmox_vm_qemu.llamas[i].vmid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,4 +19,3 @@ output "llama_vm_ids" {
|
|||||||
output "llama_vm_names" {
|
output "llama_vm_names" {
|
||||||
value = [for vm in proxmox_vm_qemu.llamas : vm.name]
|
value = [for vm in proxmox_vm_qemu.llamas : vm.name]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
target_node = "flex"
|
target_node = "flex"
|
||||||
clone_template = "ubuntu-cloudinit"
|
clone_template = "ubuntu-cloudinit"
|
||||||
vm_name = "alpine-vm"
|
|
||||||
cores = 1
|
cores = 1
|
||||||
memory = 1024
|
memory = 1024
|
||||||
disk_size = "15G"
|
disk_size = "15G"
|
||||||
sockets = 1
|
sockets = 1
|
||||||
bridge = "vmbr0"
|
bridge = "vmbr0"
|
||||||
disk_type = "scsi"
|
|
||||||
storage = "Flash"
|
storage = "Flash"
|
||||||
pm_api_url = "https://100.105.0.115:8006/api2/json"
|
pm_api_url = "https://100.105.0.115:8006/api2/json"
|
||||||
pm_user = "terraform-prov@pve"
|
pm_user = "terraform-prov@pve"
|
||||||
@@ -10,10 +10,6 @@ variable "clone_template" {
|
|||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "vm_name" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "cores" {
|
variable "cores" {
|
||||||
type = number
|
type = number
|
||||||
}
|
}
|
||||||
@@ -34,10 +30,6 @@ variable "bridge" {
|
|||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "disk_type" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "storage" {
|
variable "storage" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
@@ -50,18 +42,6 @@ variable "pm_user" {
|
|||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "alpaca_count" {
|
|
||||||
type = number
|
|
||||||
default = 1
|
|
||||||
description = "How many Alpaca VMs to create"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "llama_count" {
|
|
||||||
type = number
|
|
||||||
default = 1
|
|
||||||
description = "How many Llama VMs to create"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "alpaca_vm_count" {
|
variable "alpaca_vm_count" {
|
||||||
type = number
|
type = number
|
||||||
default = 1
|
default = 1
|
||||||
@@ -81,5 +61,5 @@ variable "TS_AUTHKEY" {
|
|||||||
|
|
||||||
variable "SSH_KEY_PUBLIC" {
|
variable "SSH_KEY_PUBLIC" {
|
||||||
type = string
|
type = string
|
||||||
description = "My Public SSH key fo ssh auth list"
|
description = "My Public SSH key for ssh auth list"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user