]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuServer/Cloudinit.pm
cloudinit: pass through hostname via fqdn field
[qemu-server.git] / PVE / QemuServer / Cloudinit.pm
index 10962b507820bad81cc437b6e91e772300a45628..cd5cc242db64e3bfa23fdf379b413b47077bd8dd 100644 (file)
@@ -87,6 +87,8 @@ sub get_hostname_fqdn {
        $hostname =~ s/\..*$//;
     } elsif (my $search = $conf->{searchdomain}) {
        $fqdn = "$hostname.$search";
+    } else {
+       $fqdn = $hostname;
     }
     return ($hostname, $fqdn);
 }
@@ -120,7 +122,7 @@ sub cloudinit_userdata {
 
     $content .= "hostname: $hostname\n";
     $content .= "manage_etc_hosts: true\n";
-    $content .= "fqdn: $fqdn\n" if defined($fqdn);
+    $content .= "fqdn: $fqdn\n";
 
     my $username = $conf->{ciuser};
     my $password = $conf->{cipassword};