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
|
- dhclient
|
||||||
- locale-gen
|
- locale-gen
|
||||||
|
|
||||||
%{ if data_share != null }
|
%{ if data_share != "" }
|
||||||
mounts:
|
mounts:
|
||||||
- ["data", "${data_share}", "9p", "trans=virtio,rw", "0", "0"]
|
- ["data", "${data_share}", "9p", "trans=virtio,rw", "0", "0"]
|
||||||
%{ endif }
|
%{ endif }
|
||||||
|
|
4
main.tf
4
main.tf
|
@ -90,7 +90,7 @@ resource "null_resource" "data_share" {
|
||||||
|
|
||||||
provisioner "remote-exec" {
|
provisioner "remote-exec" {
|
||||||
inline = [
|
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" {
|
dynamic "filesystem" {
|
||||||
for_each = var.data_share != null ? [1] : []
|
for_each = var.data_share != "" ? [1] : []
|
||||||
|
|
||||||
content {
|
content {
|
||||||
source = "/data/${local.domain_name}"
|
source = "/data/${local.domain_name}"
|
||||||
|
|
|
@ -103,8 +103,8 @@ variable "fixed_dns" {
|
||||||
|
|
||||||
variable "data_share" {
|
variable "data_share" {
|
||||||
type = string
|
type = string
|
||||||
default = null
|
default = ""
|
||||||
description = "Location for the data share on the guest OS."
|
description = "Location for the data share on the guest OS. Leave empty to disable."
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "hypervisor_host" {
|
variable "hypervisor_host" {
|
||||||
|
|
Reference in a new issue