1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

Merge pull request #1364 from joshwget/early-cloud-init

Early cloud-init
This commit is contained in:
Darren Shepherd
2016-11-16 17:05:03 -07:00
committed by GitHub
19 changed files with 318 additions and 249 deletions

View File

@@ -19,6 +19,12 @@ func bootstrapServices(cfg *config.CloudConfig) (*config.CloudConfig, error) {
return cfg, err
}
func runCloudInitServiceSet(cfg *config.CloudConfig) (*config.CloudConfig, error) {
log.Info("Running cloud-init services")
_, err := compose.RunServiceSet("cloud-init", cfg, cfg.Rancher.CloudInitServices)
return cfg, err
}
func startDocker(cfg *config.CloudConfig) (chan interface{}, error) {
launchConfig, args := getLaunchConfig(cfg, &cfg.Rancher.BootstrapDocker)
launchConfig.Fork = true
@@ -62,3 +68,17 @@ func bootstrap(cfg *config.CloudConfig) error {
bootstrapServices)
return err
}
func runCloudInitServices(cfg *config.CloudConfig) error {
c, err := startDocker(cfg)
if err != nil {
return err
}
defer stopDocker(c)
_, err = config.ChainCfgFuncs(cfg,
loadImages,
runCloudInitServiceSet)
return err
}