infra: format the terrafrom proxmox file
All checks were successful
ci/woodpecker/push/demo-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/demo-workflow Pipeline was successful
This commit is contained in:
@ -1,20 +1,20 @@
|
|||||||
terraform {
|
terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
proxmox = {
|
proxmox = {
|
||||||
source = "bpg/proxmox"
|
source = "bpg/proxmox"
|
||||||
version = "0.78.2"
|
version = "0.78.2"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
endpoint = var.pm_api_url
|
endpoint = var.pm_api_url
|
||||||
api_token = var.pm_api_token
|
api_token = var.pm_api_token
|
||||||
insecure = var.pm_insecure
|
insecure = var.pm_insecure
|
||||||
|
|
||||||
ssh {
|
ssh {
|
||||||
agent = false
|
agent = false
|
||||||
username = var.pm_user
|
username = var.pm_user
|
||||||
private_key = file(var.pm_ssh_private_key_path)
|
private_key = file(var.pm_ssh_private_key_path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ resource "proxmox_virtual_environment_vm" "ubuntu_vm" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" {
|
resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" {
|
||||||
for_each = toset(var.nodes)
|
for_each = toset(var.nodes)
|
||||||
content_type = "iso"
|
content_type = "iso"
|
||||||
datastore_id = "local"
|
datastore_id = "local"
|
||||||
node_name = each.key
|
node_name = each.key
|
||||||
@ -88,8 +88,8 @@ resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "proxmox_virtual_environment_hosts" "hosts" {
|
data "proxmox_virtual_environment_hosts" "hosts" {
|
||||||
for_each = toset(var.nodes)
|
for_each = toset(var.nodes)
|
||||||
node_name = each.key
|
node_name = each.key
|
||||||
|
|
||||||
depends_on = [proxmox_virtual_environment_vm.ubuntu_vm]
|
depends_on = [proxmox_virtual_environment_vm.ubuntu_vm]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user