From 92b55cc7f57fbe66a15df7a7d0e221ff57c7dff2 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 12 Mar 2014 18:01:57 -0700 Subject: [PATCH] fix(unit): Only enable non-network-like units --- cloudinit/cloud_config.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cloudinit/cloud_config.go b/cloudinit/cloud_config.go index ac901bb..e39dd32 100644 --- a/cloudinit/cloud_config.go +++ b/cloudinit/cloud_config.go @@ -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)