try to fix data share remote exec
This commit is contained in:
parent
8c9120df6d
commit
88e3def563
3 changed files with 6 additions and 6 deletions
|
@ -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 }
|
||||
|
|
4
main.tf
4
main.tf
|
@ -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}"
|
||||
|
|
|
@ -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" {
|
||||
|
|
Reference in a new issue