From 672e9c8066997d3ef781df010baef928673c3b6e Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Sat, 8 Oct 2016 22:23:07 +0200 Subject: Make the hostname field of cloudinit optional This fixes issue #64 --- libvirt/cloudinit_def.go | 2 +- libvirt/resource_cloud_init.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libvirt') 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{ -- cgit v1.2.3