os

package
v0.0.0-...-ea4c5e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 13

Documentation

Index

Constants

View Source
const (
	AMD64Arch = Architecture("x86_64")
	ARM64Arch = Architecture("arm64")
)

Variables

View Source
var (
	UbuntuDefault = Ubuntu2204
	Ubuntu2204    = NewDescriptor(Ubuntu, "22.04")

	DebianDefault = Debian12
	Debian12      = NewDescriptor(Debian, "12")

	AmazonLinuxDefault = AmazonLinux2023
	AmazonLinux2023    = NewDescriptor(AmazonLinux, "2023")
	AmazonLinux2       = NewDescriptor(AmazonLinux, "2")
	AmazonLinux2018    = NewDescriptor(AmazonLinux, "2018")

	AmazonLinuxECSDefault = AmazonLinuxECS2023
	AmazonLinuxECS2023    = NewDescriptor(AmazonLinuxECS, "2023")
	AmazonLinuxECS2       = NewDescriptor(AmazonLinuxECS, "2")

	RedHatDefault = RedHat9
	RedHat9       = NewDescriptor(RedHat, "9")

	SuseDefault = Suse15
	Suse15      = NewDescriptor(Suse, "15-sp4")

	FedoraDefault = Fedora40
	Fedora40      = NewDescriptor(Fedora, "40")

	CentOSDefault = CentOS7
	CentOS7       = NewDescriptor(CentOS, "7")
)

Implements commonly used descriptors for easier usage

View Source
var (
	MacOSDefault = MacOSSonoma
	MacOSSonoma  = NewDescriptorWithArch(MacosOS, "sonoma", ARM64Arch)
)

Implements commonly used descriptors for easier usage

View Source
var (
	WindowsDefault    = WindowsServer2022
	WindowsServer2022 = NewDescriptor(WindowsServer, "2022")
	WindowsServer2019 = NewDescriptor(WindowsServer, "2019")
)

Implements commonly used descriptors for easier usage

View Source
var APTDisableUnattendedUpgradesScriptContent string
View Source
var WindowsSetupSSHScriptContent string
View Source
var ZypperDisableUnattendedUpgradesScriptContent string

Functions

This section is empty.

Types

type Architecture

type Architecture string

func ArchitectureFromString

func ArchitectureFromString(archStr string) Architecture

type Descriptor

type Descriptor struct {
	Flavor       Flavor
	Version      string
	Architecture Architecture
	// contains filtered or unexported fields
}

Descriptor provides definition of an OS

func DescriptorFromString

func DescriptorFromString(descStr string, defaultDescriptor Descriptor) Descriptor

String format is <flavor>:<version>(:<arch>)

func NewDescriptor

func NewDescriptor(f Flavor, version string) Descriptor

func NewDescriptorWithArch

func NewDescriptorWithArch(f Flavor, version string, arch Architecture) Descriptor

func (Descriptor) Family

func (d Descriptor) Family() Family

func (Descriptor) String

func (d Descriptor) String() string

func (Descriptor) WithArch

func (d Descriptor) WithArch(a Architecture) Descriptor

type Family

type Family int
const (
	UnknownFamily Family = iota

	LinuxFamily   Family = iota
	WindowsFamily Family = iota
	MacOSFamily   Family = iota
)

type Flavor

type Flavor int
const (
	Unknown Flavor = iota

	// Linux
	Ubuntu         Flavor = iota
	AmazonLinux    Flavor = iota
	AmazonLinuxECS Flavor = iota
	Debian         Flavor = iota
	RedHat         Flavor = iota
	Suse           Flavor = iota
	Fedora         Flavor = iota
	CentOS         Flavor = iota
	RockyLinux     Flavor = iota

	// Windows
	WindowsServer Flavor = 500

	// MacOS
	MacosOS Flavor = 1000
)

func FlavorFromString

func FlavorFromString(flavorStr string) Flavor

func (Flavor) String

func (f Flavor) String() string

func (Flavor) Type

func (f Flavor) Type() Family

type OS

type OS interface {
	Descriptor() Descriptor

	Runner() command.Runner
	FileManager() *command.FileManager
	PackageManager() PackageManager
	ServiceManger() ServiceManager
}

OS is the high-level interface for an OS INSIDE Pulumi code

func NewOS

func NewOS(
	e config.Env,
	descriptor Descriptor,
	runner command.Runner,
) OS

type PackageManager

type PackageManager interface {
	// Ensure ensures that a package is installed
	// checkBinary is a binary that should be checked before running the install command, if it is not empty it will first run the `command -v checkBinary` command and if it fails it will run the installCmd,
	// if it succeeds we consider the package is already installed
	Ensure(packageRef string, transform command.Transformer, checkBinary string, opts ...pulumi.ResourceOption) (command.Command, error)
}

Interfaces used by OS components

type ServiceManager

type ServiceManager interface {
	// EnsureStarted starts or restarts (may be stop+start depending on implementation) the service if already running
	EnsureRestarted(serviceName string, transform command.Transformer, opts ...pulumi.ResourceOption) (command.Command, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL