func etcdContents(etcd Etcd, platform string) (string, error) {
	args := getCliArgs(etcd.Options)
	var vars []string
	if etcd.Version != nil {
		vars = []string{fmt.Sprintf("ETCD_IMAGE_TAG=v%s", etcd.Version)}
	}
	unit, err := assembleUnit("/usr/lib/coreos/etcd-wrapper $ETCD_OPTS", args, vars, platform)
	if err != nil {
		return "", err
	}
	return unit.String(), nil
}
etcdContents creates the string containing the systemd drop in for etcd-member
package types
import (
	"errors"
	"fmt"
	"github.com/coreos/go-semver/semver"
	ignTypes "github.com/coreos/ignition/config/v2_3/types"
	"github.com/coreos/ignition/config/validate/astnode"
	"github.com/coreos/ignition/config/validate/report"
)
var (
	EtcdVersionTooOld      = errors.New("Etcd version specified is not valid (too old)")
	EtcdMinorVersionTooNew = errors.New("Etcd minor version specified is too new, only options available in the previous minor version will be accepted")
	EtcdMajorVersionTooNew = errors.New("Etcd version is not valid (too new)")
	OldestEtcd             = *semver.New("2.3.0")
	EtcdDefaultVersion     = *semver.New("3.0.0")
)
type Options interface{}
type etcdCommon Etcd
type EtcdVersion semver.Version
func (e *EtcdVersion) UnmarshalYAML(unmarshal func(interface{}) error) error {
	t := semver.Version(*e)
	if err := unmarshal(&t); err != nil {
		return err
	}
	*e = EtcdVersion(t)
	return nil
}
func (e EtcdVersion) Validate() report.Report {
	v := semver.Version(e)
	switch {
	case v.LessThan(OldestEtcd):
		return report.ReportFromError(EtcdVersionTooOld, report.EntryError)
	case v.Major == 2 && v.Minor > 3:
		fallthrough
	case v.Major == 3 && v.Minor > 3:
		return report.ReportFromError(EtcdMinorVersionTooNew, report.EntryWarning)
	case v.Major > 3:
		return report.ReportFromError(EtcdMajorVersionTooNew, report.EntryError)
	}
	return report.Report{}
}
func (e EtcdVersion) String() string {
	return semver.Version(e).String()
}
type Etcd struct {
	Version *EtcdVersion `yaml:"version"`
	Options
}
func (etcd *Etcd) UnmarshalYAML(unmarshal func(interface{}) error) error {
	t := etcdCommon(*etcd)
	if err := unmarshal(&t); err != nil {
		return err
	}
	*etcd = Etcd(t)
	var version semver.Version
	if etcd.Version == nil {
		version = EtcdDefaultVersion
	} else {
		version = semver.Version(*etcd.Version)
	}
	if version.Major == 2 && version.Minor >= 3 {
		o := Etcd2{}
		if err := unmarshal(&o); err != nil {
			return err
		}
		etcd.Options = o
	} else if version.Major == 3 && version.Minor == 0 {
		o := Etcd3_0{}
		if err := unmarshal(&o); err != nil {
			return err
		}
		etcd.Options = o
	} else if version.Major == 3 && version.Minor == 1 {
		o := Etcd3_1{}
		if err := unmarshal(&o); err != nil {
			return err
		}
		etcd.Options = o
	} else if version.Major == 3 && version.Minor == 2 {
		o := Etcd3_2{}
		if err := unmarshal(&o); err != nil {
			return err
		}
		etcd.Options = o
	} else if version.Major == 3 && version.Minor >= 3 {
		o := Etcd3_3{}
		if err := unmarshal(&o); err != nil {
			return err
		}
		etcd.Options = o
	}
	return nil
}
func init() {
	register(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
		if in.Etcd != nil {
			contents, err := etcdContents(*in.Etcd, platform)
			if err != nil {
				return ignTypes.Config{}, report.ReportFromError(err, report.EntryError), ast
			}
			out.Systemd.Units = append(out.Systemd.Units, ignTypes.Unit{
				Name:   "etcd-member.service",
				Enable: true,
				Dropins: []ignTypes.SystemdDropin{{
					Name:     "20-clct-etcd-member.conf",
					Contents: contents,
				}},
			})
		}
		return out, report.Report{}, ast
	})
}