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

Early cloud-init

This commit is contained in:
Josh Curl
2016-11-09 11:08:30 -08:00
parent 72f7f9a572
commit 13b34a6668
18 changed files with 312 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
}