try to fix data share remote exec

This commit is contained in:
Pim Kunis 2023-05-08 09:18:13 +02:00
parent 8c9120df6d
commit 88e3def563
3 changed files with 6 additions and 6 deletions

View file

@ -40,7 +40,7 @@ runcmd:
- dhclient
- locale-gen
%{ if data_share != null }
%{ if data_share != "" }
mounts:
- ["data", "${data_share}", "9p", "trans=virtio,rw", "0", "0"]
%{ endif }

View file

@ -90,7 +90,7 @@ resource "null_resource" "data_share" {
provisioner "remote-exec" {
inline = [
"if [ \"${var.data_share}\" != \"null\"; then mkdir -p --mode=og=rwx /data/${local.domain_name}; fi"
"if [ \"${var.data_share}\" != \"\"; then mkdir -p --mode=og=rwx /data/${local.domain_name}; fi"
]
}
}
@ -106,7 +106,7 @@ resource "libvirt_domain" "debian" {
}
dynamic "filesystem" {
for_each = var.data_share != null ? [1] : []
for_each = var.data_share != "" ? [1] : []
content {
source = "/data/${local.domain_name}"

View file

@ -103,8 +103,8 @@ variable "fixed_dns" {
variable "data_share" {
type = string
default = null
description = "Location for the data share on the guest OS."
default = ""
description = "Location for the data share on the guest OS. Leave empty to disable."
}
variable "hypervisor_host" {