code: func (k *keepalived) WriteCfg(svcs []vip) error {
  	w, err := os.Create(keepalivedCfg)
  	if err != nil {
  		return err
  	}
  	defer w.Close()
  
  	k.vips = getVIPs(svcs)
  
  	conf := make(map[string]interface{})
  	conf["iptablesChain"] = iptablesChain
  	conf["iface"] = k.iface
  	conf["myIP"] = k.ip
  	conf["netmask"] = k.netmask
  	conf["svcs"] = svcs
  	conf["vips"] = getVIPs(svcs)
  	conf["nodes"] = k.neighbors
  	conf["priority"] = k.priority
  	conf["useUnicast"] = k.useUnicast
  	conf["vrid"] = k.vrid
  	conf["vrrpVersion"] = k.vrrpVersion
  	conf["notify"] = k.notify
  
  	if glog.V(2) {
  		b, _ := json.Marshal(conf)
  		glog.Infof("%v", string(b))
  	}
  
  	return k.tmpl.Execute(w, conf)
  }
docs: // WriteCfg creates a new keepalived configuration file.
  // In case of an error with the generation it returns the error