fix(unit): Only enable non-network-like units
This commit is contained in:
parent
fcc2e044b1
commit
92b55cc7f5
@ -67,16 +67,22 @@ func ApplyCloudConfig(cfg CloudConfig, sshKeyName string) error {
|
||||
|
||||
if len(cfg.Coreos.Units) > 0 {
|
||||
for _, unit := range cfg.Coreos.Units {
|
||||
log.Printf("Placing unit %s on filesystem", unit.Name)
|
||||
dst, err := PlaceUnit("/", &unit)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf("Placed unit %s at %s", unit.Name, dst)
|
||||
|
||||
if err := EnableUnitFile(dst, unit.Runtime); err != nil {
|
||||
return err
|
||||
if unit.Group() != "network" {
|
||||
log.Printf("Enabling unit file %s", dst)
|
||||
if err := EnableUnitFile(dst, unit.Runtime); err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf("Enabled unit %s", unit.Name)
|
||||
} else {
|
||||
log.Printf("Skipping enable for network-like unit %s", unit.Name)
|
||||
}
|
||||
log.Printf("Enabled unit %s", unit.Name)
|
||||
}
|
||||
DaemonReload()
|
||||
StartUnits(cfg.Coreos.Units)
|
||||
|
Loading…
x
Reference in New Issue
Block a user