summaryrefslogtreecommitdiff
path: root/libvirt
diff options
context:
space:
mode:
authorFlavio Castelli <fcastelli@suse.com>2016-10-08 22:23:07 +0200
committerFlavio Castelli <fcastelli@suse.com>2016-10-08 22:23:07 +0200
commit672e9c8066997d3ef781df010baef928673c3b6e (patch)
treee10d4c2ef05adc84bbe8903e62f6383ea5b6e50b /libvirt
parentfdd13354ef6a19b0d75cb9f8e395239a2af86317 (diff)
downloadterraform-provider-libvirt-672e9c8066997d3ef781df010baef928673c3b6e.tar
terraform-provider-libvirt-672e9c8066997d3ef781df010baef928673c3b6e.tar.gz
Make the hostname field of cloudinit optional
This fixes issue #64
Diffstat (limited to 'libvirt')
-rw-r--r--libvirt/cloudinit_def.go2
-rw-r--r--libvirt/resource_cloud_init.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/libvirt/cloudinit_def.go b/libvirt/cloudinit_def.go
index 1712e067..da7e5f69 100644
--- a/libvirt/cloudinit_def.go
+++ b/libvirt/cloudinit_def.go
@@ -26,7 +26,7 @@ type defCloudInit struct {
Name string
PoolName string
Metadata struct {
- LocalHostname string `yaml:"local-hostname"`
+ LocalHostname string `yaml:"local-hostname,omitempty"`
InstanceID string `yaml:"instance-id"`
}
UserData struct {
diff --git a/libvirt/resource_cloud_init.go b/libvirt/resource_cloud_init.go
index 23f72976..14522d2d 100644
--- a/libvirt/resource_cloud_init.go
+++ b/libvirt/resource_cloud_init.go
@@ -25,7 +25,7 @@ func resourceCloudInit() *schema.Resource {
},
"local_hostname": &schema.Schema{
Type: schema.TypeString,
- Required: true,
+ Optional: true,
ForceNew: true,
},
"ssh_authorized_key": &schema.Schema{