Skip to content

Commit a3046c7

Browse files
authored
null vars (#17)
* use null variables instead of empty strings * use null variables instead of empty strings
1 parent 3d2c7e7 commit a3046c7

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Fixed
1313

1414
- Correct conditional logic.
15+
- Use null vars instead of strings.
1516

1617
## [1.2.0] - 2022-11-27
1718

instance.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ resource "proxmox_vm_qemu" "proxmox_instance" {
33
desc = var.pve_instance_description
44
vmid = var.vmid
55

6-
clone = var.pxe_boot == true ? "" : var.clone
7-
full_clone = var.pxe_boot == true ? false : var.full_clone
6+
clone = var.pxe_boot == true ? null : var.clone
7+
full_clone = var.pxe_boot == true ? null : var.full_clone
88
pxe = var.pxe_boot
99
boot = var.boot
1010

@@ -36,10 +36,10 @@ resource "proxmox_vm_qemu" "proxmox_instance" {
3636
}
3737
}
3838

39-
os_type = var.pxe_boot == true ? "" : var.os_type
40-
cicustom = var.pxe_boot == true ? "" : var.cicustom
39+
os_type = var.pxe_boot == true ? null : var.os_type
40+
cicustom = var.pxe_boot == true ? null : var.cicustom
4141
# example: "user=${var.citemplate_storage}:${var.snippet_dir}/user-${var.snippet_file_base},network=${var.citemplate_storage}:${var.snippet_dir}/network-${var.snippet_file_base}"
42-
cloudinit_cdrom_storage = var.pxe_boot == true ? "" : var.cloudinit_cdrom_storage
42+
cloudinit_cdrom_storage = var.pxe_boot == true ? null : var.cloudinit_cdrom_storage
4343

4444
searchdomain = var.searchdomain
4545
nameserver = var.nameserver

variables.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ variable "vmid" {
1414
}
1515

1616
variable "clone" {
17-
default = ""
17+
default = null
1818
description = "Name of the template to clone (ignored when pxe_boot is true)."
1919
type = string
2020
}
2121

2222
variable "full_clone" {
23-
default = false
23+
default = null
2424
description = "Create a full clone; if false, a linked clone will be created (ignored when pxe_boot is true)."
2525
type = bool
2626
}
@@ -89,7 +89,7 @@ variable "disks" {
8989
}
9090

9191
variable "os_type" {
92-
default = ""
92+
default = null
9393
description = "Type of OS for preprovisioning."
9494
type = string
9595
}
@@ -107,20 +107,20 @@ variable "snippet_file_base" {
107107
}
108108

109109
variable "cicustom" {
110-
default = ""
110+
default = null
111111
description = "Path(s) to cloud-init config files (ignored when pxe_boot is true)."
112112
type = string
113113
}
114114

115115
variable "citemplate_storage" {
116-
default = "local"
116+
default = null
117117
description = "Name of the storage containing the cloud-init snippets (ignored when pxe_boot is true)."
118118
type = string
119119
}
120120

121121
variable "cloudinit_cdrom_storage" {
122-
default = "local-lvm"
123-
description = "Name of the storage to create the cloud-init image in."
122+
default = null
123+
description = "Name of the storage to create the cloud-init image in (e.g. local-lvm)."
124124
type = string
125125
}
126126

0 commit comments

Comments
 (0)