phases

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Ubuntu = ubuntu{}
	Debian = debian{}
)
View Source
var (
	Redhat           = redhat{}
	Centos           = centos{}
	Fedora           = fedora{}
	RedhatEnterprise = rhel{}
	AmazonLinux      = amazonLinux{}
)
View Source
var AnsiblePhase types.Phase = ansible{}
View Source
var BaseOperatingSystems = OperatingSystemList{
	Debian,
	Redhat,
	Fedora,
	Photon,
}

BaseOperatingSystems is the list of base distributions that are supported, which is currently only debian and redhat

View Source
var CommandsPhase types.AllPhases = command{}
View Source
var Containers types.Phase = containers{}
View Source
var Environment types.Phase = environment{}
View Source
var Files types.Phase = filesPhase{}
View Source
var Kernel types.AllPhases = kernel{}
View Source
var OperatingSystems = map[string]OS{
	"ubuntu":      Ubuntu,
	"debian":      Debian,
	"redhat":      Redhat,
	"amazonLinux": AmazonLinux,
	"centos":      Centos,
	"fedora":      Fedora,
	"photon":      Photon,
}
View Source
var Packages types.AllPhases = packages{}
View Source
var Photon = photon{}
View Source
var Services types.Phase = services{}

SupportedOperatingSystems is a list of all supported OS's, used primarily for detecting runtime flags

View Source
var Sysctl types.Phase = sysctl{}
View Source
var TrustedCA types.Phase = trustedCA{}
View Source
var Users types.Phase = users{}

Functions

func Lookup

func Lookup(path string) string

func VerifyService

func VerifyService(name string, results *types.VerifyResults) bool

VerifyService checks that the service is enabled and running

Types

type AptPackageManager

type AptPackageManager struct {
}

func (AptPackageManager) AddRepo

func (p AptPackageManager) AddRepo(uri string, channel string, versionCodeName string, name string, gpgKey string, extraArgs map[string]string) types.Commands

func (AptPackageManager) CleanupCaches

func (p AptPackageManager) CleanupCaches() types.Commands

func (AptPackageManager) GetInstalledVersion

func (p AptPackageManager) GetInstalledVersion(pkg string) string

func (AptPackageManager) GetKernelPackageNames added in v0.10.0

func (p AptPackageManager) GetKernelPackageNames(version string) (string, string)

func (AptPackageManager) Install

func (p AptPackageManager) Install(pkg ...string) types.Commands

func (AptPackageManager) ListInstalled

func (p AptPackageManager) ListInstalled() string

func (AptPackageManager) Mark

func (p AptPackageManager) Mark(pkg ...string) types.Commands

func (AptPackageManager) Uninstall

func (p AptPackageManager) Uninstall(pkg ...string) types.Commands

func (AptPackageManager) Update

func (p AptPackageManager) Update() types.Commands

type DnfPackageManager

type DnfPackageManager struct{}

func (DnfPackageManager) AddRepo

func (p DnfPackageManager) AddRepo(url string, channel string, versionCodeName string, name string, gpgKey string, extraArgs map[string]string) types.Commands

func (DnfPackageManager) CleanupCaches

func (p DnfPackageManager) CleanupCaches() types.Commands

func (DnfPackageManager) GetInstalledVersion

func (p DnfPackageManager) GetInstalledVersion(pkg string) string

func (DnfPackageManager) GetKernelPackageNames added in v0.10.0

func (p DnfPackageManager) GetKernelPackageNames(version string) (string, string)

func (DnfPackageManager) Install

func (p DnfPackageManager) Install(pkg ...string) types.Commands

func (DnfPackageManager) Mark

func (p DnfPackageManager) Mark(pkg ...string) types.Commands

func (DnfPackageManager) Uninstall

func (p DnfPackageManager) Uninstall(pkg ...string) types.Commands

func (DnfPackageManager) Update

func (p DnfPackageManager) Update() types.Commands

type GrubConfManager added in v0.10.0

type GrubConfManager struct{}

Generally used by apt systems

func (GrubConfManager) ReadDefaultKernel added in v0.10.0

func (p GrubConfManager) ReadDefaultKernel() (string, bool)

func (GrubConfManager) UpdateDefaultKernel added in v0.10.0

func (p GrubConfManager) UpdateDefaultKernel(version string) types.Commands

type GrubConfigManager added in v0.10.0

type GrubConfigManager interface {
	ReadDefaultKernel() (string, bool)
	UpdateDefaultKernel(version string) types.Commands
}

Interface and corresponding structs for reading/writing grub config with grub.conf or grubby

type GrubbyManager added in v0.10.0

type GrubbyManager struct{}

Generally used by yum systems

func (GrubbyManager) ReadDefaultKernel added in v0.10.0

func (p GrubbyManager) ReadDefaultKernel() (string, bool)

func (GrubbyManager) UpdateDefaultKernel added in v0.10.0

func (p GrubbyManager) UpdateDefaultKernel(version string) types.Commands

type OS

type OS interface {

	// GetVersionCodeName returns the distributions version codename e.g. bionic, xenial, squeeze
	GetVersionCodeName() string

	//GetPackageManager returns the packagemanager used by the OS
	GetPackageManager() types.PackageManager

	//GetTags returns all the tags to which this OS applies
	GetTags() []types.Flag

	GetName() string

	//DetectAtRuntime will detect if it is compatible with the current running OS
	DetectAtRuntime() bool

	// Returns the names of the kernel and kernel header packages
	GetKernelPackageNames(version string) (string, string)

	// Calls the version specific grub config logic
	UpdateDefaultKernel(version string) types.Commands

	// Check whether defaul kernel matches specific version
	ReadDefaultKernel() string
}

OS provides an abstraction over different operating systems

func GetOSForTag

func GetOSForTag(tags ...types.Flag) (OS, error)

type OperatingSystemList

type OperatingSystemList []OS

func (OperatingSystemList) Detect

func (l OperatingSystemList) Detect() []OS

Detect returns a list of all compatible operating systems at runtime

type TdnfPackageManager added in v0.10.0

type TdnfPackageManager struct{}

func (TdnfPackageManager) AddRepo added in v0.10.0

func (p TdnfPackageManager) AddRepo(url string, channel string, versionCodeName string, name string, gpgKey string, extraArgs map[string]string) types.Commands

func (TdnfPackageManager) CleanupCaches added in v0.10.0

func (p TdnfPackageManager) CleanupCaches() types.Commands

func (TdnfPackageManager) GetInstalledVersion added in v0.10.0

func (p TdnfPackageManager) GetInstalledVersion(pkg string) string

func (TdnfPackageManager) GetKernelPackageNames added in v0.10.0

func (p TdnfPackageManager) GetKernelPackageNames(version string) (string, string)

func (TdnfPackageManager) Install added in v0.10.0

func (p TdnfPackageManager) Install(pkg ...string) types.Commands

func (TdnfPackageManager) Mark added in v0.10.0

func (p TdnfPackageManager) Mark(pkg ...string) types.Commands

func (TdnfPackageManager) Uninstall added in v0.10.0

func (p TdnfPackageManager) Uninstall(pkg ...string) types.Commands

func (TdnfPackageManager) Update added in v0.10.0

func (p TdnfPackageManager) Update() types.Commands

type YumPackageManager

type YumPackageManager struct{}

func (YumPackageManager) AddRepo

func (p YumPackageManager) AddRepo(url string, channel string, versionCodeName string, name string, gpgKey string, extraArgs map[string]string) types.Commands

func (YumPackageManager) CleanupCaches

func (p YumPackageManager) CleanupCaches() types.Commands

func (YumPackageManager) GetInstalledVersion

func (p YumPackageManager) GetInstalledVersion(pkg string) string

func (YumPackageManager) GetKernelPackageNames added in v0.10.0

func (p YumPackageManager) GetKernelPackageNames(version string) (string, string)

func (YumPackageManager) Install

func (p YumPackageManager) Install(pkg ...string) types.Commands

func (YumPackageManager) Mark

func (p YumPackageManager) Mark(pkg ...string) types.Commands

func (YumPackageManager) Uninstall

func (p YumPackageManager) Uninstall(pkg ...string) types.Commands

func (YumPackageManager) Update

func (p YumPackageManager) Update() types.Commands

Jump to

Keyboard shortcuts

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