func handleHostname(contents string, scripts_dir string) (*cloudinit.CloudConfig, error) { config := cloudinit.CloudConfig{} hostname := contents // HOSTNAME="polvi-test" re := regexp.MustCompile("HOSTNAME=\"(.+)\"") keys := re.FindStringSubmatch(hostname) if len(keys) == 2 { hostname := keys[1] config.Hostname = hostname } return &config, nil }