3
func User(x string) Option {
5
return Option{"user", maybe(x != "", x)}
8
func AptUpgrade(yes bool) Option {
10
return Option{"apt_upgrade", maybe(yes, yes)}
13
func AptUpdate(yes bool) Option {
15
return Option{"apt_update", maybe(yes, yes)}
18
func AptMirror(url string) Option {
20
return Option{"apt_mirror", maybe(url != "", url)}
23
func AptPreserveSourcesList(yes bool) Option {
25
return Option{"apt_mirror", maybe(yes, yes)}
28
func AptOldMirror(url string) Option {
30
return Option{"apt_old_mirror", maybe(url != "", url)}
33
func AptSources(x ...*Source) Option {
36
return Option{"apt_sources", nil}
38
ss := make([]*source, len(x))
42
return Option{"apt_sources", ss}
45
func DebConfSelections(x bool) Option {
47
return Option{"debconf_selections", maybe(x, x)}
50
func Packages(x ...string) Option {
52
return Option{"packages", maybe(len(x) > 0, x)}
55
func BootCmd(x ...*Command) Option {
57
return Option{"bootcmd", maybe(len(x) > 0, x)}
60
func DisableEC2Metadata(x bool) Option {
61
// disable_ec2_metadata
62
return Option{"disable_ec2_metadata", maybe(x, x)}
65
func FinalMessage(x string) Option {
67
return Option{"final_message", maybe(x != "", x)}
70
func Locale(x string) Option {
72
return Option{"locale", maybe(x != "", x)}
75
func Mounts(x [][]string) Option {
77
return Option{"mounts", maybe(len(x) > 0, x)}
80
// Output specifies destination for command output.
81
// Valid values for the string keys are "init", "config", "final" and "all".
82
func Output(specs map[string]OutputSpec) Option {
83
return Option{"output", maybe(len(specs) > 0, specs)}
86
func SSHKeys(x []Key) Option {
88
return Option{"ssh_keys", maybe(len(x) > 0, x)}
91
func DisableRoot(x bool) Option {
93
// note that disable_root defaults to true, so we include
94
// the option only if x is false.
95
return Option{"disable_root", maybe(!x, x)}
98
func SSHAuthorizedKeys(x ...string) Option {
100
return Option{"ssh_authorized_keys", maybe(len(x) > 0, x)}
103
func RunCmd(x ...*Command) Option {
105
return Option{"runcmd", maybe(len(x) > 0, x)}
115
// rightscale_userdata
118
// scripts_per_instance