environment: encapsulate the environment images are deployed to

This represents how our systems should integrate into their environment, typically using
some sort of agent, or commonly cloud-init.

In the future we could imagine this representing network configuration or any other kind
of configuration necessary to reach the environment as well.

For now EC2 and Azure is supported, and stub environments are
added to show the idea, but these are not implemented/used
yet.
This commit is contained in:
Tom Gundersen 2022-07-06 12:28:52 +01:00
parent 7a534d4d1e
commit 452cb2dae9
10 changed files with 89 additions and 15 deletions

View file

@ -10,6 +10,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/disk"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/environment"
"github.com/osbuild/osbuild-composer/internal/manifest"
"github.com/osbuild/osbuild-composer/internal/platform"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
@ -166,7 +167,6 @@ var (
Locale: "en_US.UTF-8",
EnabledServices: []string{
"sshd",
"waagent",
},
DefaultTarget: "multi-user.target",
DisabledServices: []string{
@ -182,6 +182,7 @@ var (
payloadPipelines: []string{"os", "image", "vpc"},
exports: []string{"vpc"},
basePartitionTables: defaultBasePartitionTables,
environment: &environment.Azure{},
}
vmdkImgType = imageType{
@ -238,9 +239,6 @@ var (
// default EC2 images config (common for all architectures)
defaultEc2ImageConfig = &distro.ImageConfig{
EnabledServices: []string{
"cloud-init.service",
},
DefaultTarget: "multi-user.target",
}
@ -260,6 +258,7 @@ var (
payloadPipelines: []string{"os", "image"},
exports: []string{"image"},
basePartitionTables: defaultBasePartitionTables,
environment: &environment.EC2{},
}
containerImgType = imageType{
@ -460,6 +459,7 @@ type packageSetFunc func(t *imageType) rpmmd.PackageSet
type imageType struct {
arch *architecture
platform platform.Platform
environment environment.Environment
name string
nameAliases []string
filename string

View file

@ -234,6 +234,7 @@ func osPipeline(m *manifest.Manifest,
imageConfig := t.getDefaultImageConfig()
pl := manifest.NewOSPipeline(m, buildPipeline, t.platform, repos)
pl.Environment = t.environment
pl.Workload = workload
if t.bootable {
@ -341,7 +342,6 @@ func osPipeline(m *manifest.Manifest,
pl.SshdConfig = imageConfig.SshdConfig
pl.AuthConfig = imageConfig.Authconfig
pl.PwQuality = imageConfig.PwQuality
pl.WAAgentConfig = imageConfig.WAAgentConfig
return pl, nil
}

View file

@ -18,7 +18,6 @@ func ec2CommonPackageSet(t *imageType) rpmmd.PackageSet {
"chrony",
"langpacks-en",
"libxcrypt-compat",
"cloud-init",
"checkpolicy",
"net-tools",
},
@ -64,7 +63,6 @@ func vhdCommonPackageSet(t *imageType) rpmmd.PackageSet {
"langpacks-en",
"net-tools",
"ntfsprogs",
"WALinuxAgent",
"libxcrypt-compat",
"initscripts",
"glibc-all-langpacks",