pxemgr

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0, Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExecutionFailed

func IsExecutionFailed(err error) bool

IsExecutionFailed asserts executionFailedError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func PXEManager

func PXEManager(c PXEManagerConfiguration, cluster *hostmgr.Cluster) (*pxeManagerT, error)

Types

type CaReference

type CaReference struct {
	Source       string       `json:"source,omitempty" yaml:"source,omitempty"`
	Verification Verification `json:"verification,omitempty" yaml:"verification,omitempty"`
}

This schema structure is based on github.com/coreos/ignition/config/v2_2/types/schema.go Due to issue with unmarshalling embedded anonymous nested structures, this file removes such structures. Changed types: Directory, File, Link.

type Config

type Config struct {
	Ignition Ignition `json:"ignition" yaml:"ignition,omitempty"`
	Networkd Networkd `json:"networkd,omitempty" yaml:"networkd,omitempty"`
	Passwd   Passwd   `json:"passwd,omitempty" yaml:"passwd,omitempty"`
	Storage  Storage  `json:"storage,omitempty" yaml:"storage,omitempty"`
	Systemd  Systemd  `json:"systemd,omitempty" yaml:"systemd,omitempty"`
}

type ConfigReference

type ConfigReference struct {
	Source       string       `json:"source,omitempty" yaml:"source,omitempty"`
	Verification Verification `json:"verification,omitempty" yaml:"verification,omitempty"`
}

type Configuration

type Configuration struct {
	DefaultFlatcarVersion string `yaml:"default_flatcar_version"`
	Network               Network
	Profiles              []Profile
	TemplatesEnv          map[string]interface{} `yaml:"templates_env"`
}

func LoadConfig

func LoadConfig(filePath string) (Configuration, error)

type Create

type Create struct {
	Force   bool           `json:"force,omitempty" yaml:"force,omitempty"`
	Options []CreateOption `json:"options,omitempty" yaml:"options,omitempty"`
}

type CreateOption

type CreateOption string

type DNSmasqConfiguration

type DNSmasqConfiguration struct {
	Executable string
	Template   string
	TFTPRoot   string
	PXEPort    int

	Logger micrologger.Logger
}

type DNSmasqInstance

type DNSmasqInstance struct {
	// contains filtered or unexported fields
}

func NewDNSmasq

func NewDNSmasq(baseFile string, conf DNSmasqConfiguration) *DNSmasqInstance

func (*DNSmasqInstance) Restart

func (dnsmasq *DNSmasqInstance) Restart() error

func (*DNSmasqInstance) Start

func (dnsmasq *DNSmasqInstance) Start() error

type Device

type Device string

type Directory

type Directory struct {
	Filesystem string     `json:"filesystem,omitempty" yaml:"filesystem,omitempty"`
	Group      *NodeGroup `json:"group,omitempty" yaml:"group,omitempty"`
	Mode       *int       `json:"mode,omitempty" yaml:"mode,omitempty"`
	Overwrite  *bool      `json:"overwrite,omitempty" yaml:"overwrite,omitempty"`
	Path       string     `json:"path,omitempty" yaml:"path,omitempty"`
	User       *NodeUser  `json:"user,omitempty" yaml:"user,omitempty"`
}

type Disk

type Disk struct {
	Device     string      `json:"device,omitempty" yaml:"device,omitempty"`
	Partitions []Partition `json:"partitions,omitempty" yaml:"partitions,omitempty"`
	WipeTable  bool        `json:"wipeTable,omitempty" yaml:"wipeTable,omitempty"`
}

type EtcdNode

type EtcdNode struct {
	Key   string      `json:"key"`
	Value string      `json:"value,omitempty"`
	Nodes []*EtcdNode `json:"nodes,omitempty"`
	Dir   bool        `json:"dir,omitempty"`
}

type EtcdResponse

type EtcdResponse struct {
	Action string    `json:"action"`
	Node   *EtcdNode `json:"node,omitempty"`
}

type EtcdResponseError

type EtcdResponseError struct {
	ErrorCode int    `json:"errorCode"`
	Message   string `json:"message"`
	Cause     string `json:"cause"`
}

type File

type File struct {
	Append     bool         `json:"append,omitempty" yaml:"append,omitempty"`
	Contents   FileContents `json:"contents,omitempty" yaml:"contents,omitempty"`
	Filesystem string       `json:"filesystem,omitempty" yaml:"filesystem,omitempty"`
	Mode       int          `json:"mode,omitempty" yaml:"mode,omitempty"`
	Group      *NodeGroup   `json:"group,omitempty" yaml:"group,omitempty"`
	Overwrite  *bool        `json:"overwrite,omitempty" yaml:"overwrite,omitempty"`
	Path       string       `json:"path,omitempty" yaml:"path,omitempty"`
	User       *NodeUser    `json:"user,omitempty" yaml:"user,omitempty"`
}

type FileContents

type FileContents struct {
	Compression  string       `json:"compression,omitempty" yaml:"compression,omitempty"`
	Source       string       `json:"source,omitempty" yaml:"source,omitempty"`
	Verification Verification `json:"verification,omitempty" yaml:"verification,omitempty"`
}

type Files

type Files map[string]string

Files is map[string]string for files that we fetched from disk and then filled with data.

type Filesystem

type Filesystem struct {
	Mount *Mount  `json:"mount,omitempty" yaml:"mount,omitempty"`
	Name  string  `json:"name,omitempty" yaml:"name,omitempty"`
	Path  *string `json:"path,omitempty" yaml:"path,omitempty"`
}

type Group

type Group string

type Ignition

type Ignition struct {
	Config   IgnitionConfig `json:"config,omitempty" yaml:"config,omitempty"`
	Security Security       `json:"security,omitempty" yaml:"security,omitempty"`
	Timeouts Timeouts       `json:"timeouts,omitempty" yaml:"timeouts,omitempty"`
	Version  string         `json:"version,omitempty" yaml:"version,omitempty"`
}

type IgnitionConfig

type IgnitionConfig struct {
	Append  []ConfigReference `json:"append,omitempty" yaml:"append,omitempty"`
	Replace *ConfigReference  `json:"replace,omitempty" yaml:"replace,omitempty"`
}
type Link struct {
	Filesystem string     `json:"filesystem,omitempty" yaml:"filesystem,omitempty"`
	Group      *NodeGroup `json:"group,omitempty" yaml:"group,omitempty"`
	Hard       bool       `json:"hard,omitempty" yaml:"hard,omitempty"`
	Overwrite  *bool      `json:"overwrite,omitempty" yaml:"overwrite,omitempty"`
	Path       string     `json:"path,omitempty" yaml:"path,omitempty"`
	Target     string     `json:"target,omitempty" yaml:"target,omitempty"`
	User       *NodeUser  `json:"user,omitempty" yaml:"user,omitempty"`
}

type Mount

type Mount struct {
	Create         *Create       `json:"create,omitempty" yaml:"create,omitempty"`
	Device         string        `json:"device,omitempty" yaml:"device,omitempty"`
	Format         string        `json:"format,omitempty" yaml:"format,omitempty"`
	Label          *string       `json:"label,omitempty" yaml:"label,omitempty"`
	Options        []MountOption `json:"options,omitempty" yaml:"options,omitempty"`
	UUID           *string       `json:"uuid,omitempty" yaml:"uuid,omitempty"`
	WipeFilesystem bool          `json:"wipeFilesystem,omitempty" yaml:"wipeFilesystem,omitempty"`
}

type MountOption

type MountOption string

type Network

type Network struct {
	BindAddr string `yaml:"bind_addr"`
	PXE      struct {
		Enabled      bool
		PxeInterface NetworkInterface `yaml:"pxe_interface"`
	} `yaml:"pxe"`

	PrimaryNIC NetworkInterface   `yaml:"primary_nic"`
	ExtraNICs  []NetworkInterface `yaml:"extra_nics"`

	// if set true use UEFI boot, otherwise use legacy BIOS
	UEFI bool

	// NTP list for installed machines
	NTP []string

	IgnoredHosts []string
	StaticHosts  []hostmgr.IPMac
}

type NetworkInterface

type NetworkInterface struct {
	Routes        []NetworkRoute `yaml:"routes"`
	InterfaceName string         `yaml:"interface_name"`
	IPRange       NetworkRange   `yaml:"ip_range"`
	SubnetSize    string         `yaml:"subnet_size"`
	SubnetGateway string         `yaml:"subnet_gateway"`
	Model         NetworkModel   `yaml:"network_model"`

	DNS []string `yaml:"dns"`
}

type NetworkModel

type NetworkModel struct {
	Type               string `yaml:"type"`
	VlanId             string `yaml:"vlan_id"`
	BondMode           string `yaml:"bond_mode"`
	BondInterfaceMatch string `yaml:"bond_interface_match"`
}

type NetworkRange

type NetworkRange struct {
	Start string
	End   string
}

type NetworkRoute

type NetworkRoute struct {
	DestinationCIDR string `yaml:"destination_cidr"`
	RouteHop        string `yaml:"route_hop"`
}

type Networkd

type Networkd struct {
	Units []Networkdunit `json:"units,omitempty" yaml:"units,omitempty"`
}

type NetworkdDropin

type NetworkdDropin struct {
	Contents string `json:"contents,omitempty" yaml:"contents,omitempty"`
	Name     string `json:"name,omitempty" yaml:"name,omitempty"`
}

type Networkdunit

type Networkdunit struct {
	Contents string           `json:"contents,omitempty" yaml:"contents,omitempty"`
	Dropins  []NetworkdDropin `json:"dropins,omitempty" yaml:"dropins,omitempty"`
	Name     string           `json:"name,omitempty" yaml:"name,omitempty"`
}

type Node

type Node struct {
	Filesystem string     `json:"filesystem,omitempty" yaml:"filesystem,omitempty"`
	Group      *NodeGroup `json:"group,omitempty" yaml:"group,omitempty"`
	Overwrite  *bool      `json:"overwrite,omitempty" yaml:"overwrite,omitempty"`
	Path       string     `json:"path,omitempty" yaml:"path,omitempty"`
	User       *NodeUser  `json:"user,omitempty" yaml:"user,omitempty"`
}

type NodeGroup

type NodeGroup struct {
	ID   *int   `json:"id,omitempty" yaml:"id,omitempty"`
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
}

type NodeUser

type NodeUser struct {
	ID   *int   `json:"id,omitempty" yaml:"id,omitempty"`
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
}

type PXEManagerConfiguration

type PXEManagerConfiguration struct {
	ConfigFile               string
	UseInternalEtcdDiscovery bool
	EtcdQuorumSize           int
	EtcdDiscoveryUrl         string
	EtcdEndpoint             string
	EtcdCAFile               string
	DNSmasqExecutable        string
	DNSmasqTemplate          string
	TFTPRoot                 string
	NoTLS                    bool
	TLSCertFile              string
	TLSKeyFile               string
	APIPort                  int
	PXEPort                  int
	BindAddress              string
	FileServerPath           string
	StaticHTMLPath           string
	TemplateSnippets         string
	IgnitionConfig           string
	ImagesCacheDir           string
	FilesDir                 string
	Version                  string
	FlatcarAutologin         bool
	ConsoleTTY               bool
	SystemdShell             bool

	Logger micrologger.Logger
}

type Partition

type Partition struct {
	GUID     string `json:"guid,omitempty" yaml:"guid,omitempty"`
	Label    string `json:"label,omitempty" yaml:"label,omitempty"`
	Number   int    `json:"number,omitempty" yaml:"number,omitempty"`
	Size     int    `json:"size,omitempty" yaml:"size,omitempty"`
	Start    int    `json:"start,omitempty" yaml:"start,omitempty"`
	TypeGUID string `json:"typeGuid,omitempty" yaml:"typeGUID,omitempty"`
}

type Passwd

type Passwd struct {
	Groups []PasswdGroup `json:"groups,omitempty" yaml:"groups,omitempty"`
	Users  []PasswdUser  `json:"users,omitempty" yaml:"users,omitempty"`
}

type PasswdGroup

type PasswdGroup struct {
	Gid          *int   `json:"gid,omitempty" yaml:"gid,omitempty"`
	Name         string `json:"name,omitempty" yaml:"name,omitempty"`
	PasswordHash string `json:"passwordHash,omitempty" yaml:"passwordHash,omitempty"`
	System       bool   `json:"system,omitempty" yaml:"system,omitempty"`
}

type PasswdUser

type PasswdUser struct {
	Create            *Usercreate        `json:"create,omitempty" yaml:"create,omitempty"`
	Gecos             string             `json:"gecos,omitempty" yaml:"gecos,omitempty"`
	Groups            []Group            `json:"groups,omitempty" yaml:"groups,omitempty"`
	HomeDir           string             `json:"homeDir,omitempty" yaml:"homeDir,omitempty"`
	Name              string             `json:"name,omitempty" yaml:"name,omitempty"`
	NoCreateHome      bool               `json:"noCreateHome,omitempty" yaml:"noCreateHome,omitempty"`
	NoLogInit         bool               `json:"noLogInit,omitempty" yaml:"noLogInit,omitempty"`
	NoUserGroup       bool               `json:"noUserGroup,omitempty" yaml:"noUserGroup,omitempty"`
	PasswordHash      *string            `json:"passwordHash,omitempty" yaml:"passwordHash,omitempty"`
	PrimaryGroup      string             `json:"primaryGroup,omitempty" yaml:"primaryGroup,omitempty"`
	SSHAuthorizedKeys []SSHAuthorizedKey `json:"sshAuthorizedKeys,omitempty" yaml:"sshAuthorizedKeys,omitempty"`
	Shell             string             `json:"shell,omitempty" yaml:"shell,omitempty"`
	System            bool               `json:"system,omitempty" yaml:"system,omitempty"`
	UID               *int               `json:"uid,omitempty" yaml:"uid,omitempty"`
}

type Profile

type Profile struct {
	Quantity         int
	Name             string
	Tags             []string
	DisableEngine    bool   `yaml:"disable_engine"`
	FlatcarVersion   string `yaml:"flatcar_version"`
	EtcdClusterToken string `yaml:"etcd_cluster_token"`
}

type Raid

type Raid struct {
	Devices []Device     `json:"devices,omitempty" yaml:"devices,omitempty"`
	Level   string       `json:"level,omitempty" yaml:"level,omitempty"`
	Name    string       `json:"name,omitempty" yaml:"name,omitempty"`
	Options []RaidOption `json:"options,omitempty" yaml:"options,omitempty"`
	Spares  int          `json:"spares,omitempty" yaml:"spares,omitempty"`
}

type RaidOption

type RaidOption string

type SSHAuthorizedKey

type SSHAuthorizedKey string

type Security

type Security struct {
	TLS TLS `json:"tls,omitempty" yaml:"tls,omitempty"`
}

type Storage

type Storage struct {
	Directories []Directory  `json:"directories,omitempty" yaml:"directories,omitempty"`
	Disks       []Disk       `json:"disks,omitempty" yaml:"disks,omitempty"`
	Files       []File       `json:"files,omitempty" yaml:"files,omitempty"`
	Filesystems []Filesystem `json:"filesystems,omitempty" yaml:"filesystems,omitempty"`
	Links       []Link       `json:"links,omitempty" yaml:"links,omitempty"`
	Raid        []Raid       `json:"raid,omitempty" yaml:"raid,omitempty"`
}

type Systemd

type Systemd struct {
	Units []Unit `json:"units,omitempty" yaml:"units,omitempty"`
}

type SystemdDropin

type SystemdDropin struct {
	Contents string `json:"contents,omitempty" yaml:"contents,omitempty"`
	Name     string `json:"name,omitempty" yaml:"name,omitempty"`
}

type TLS

type TLS struct {
	CertificateAuthorities []CaReference `json:"certificateAuthorities,omitempty" yaml:"certificateAuthorities,omitempty"`
}

type Timeouts

type Timeouts struct {
	HTTPResponseHeaders *int `json:"httpResponseHeaders,omitempty" yaml:"httpResponseHeaders,omitempty"`
	HTTPTotal           *int `json:"httpTotal,omitempty" yaml:"httpTotal,omitempty"`
}

type Unit

type Unit struct {
	Contents string          `json:"contents,omitempty" yaml:"contents,omitempty"`
	Dropins  []SystemdDropin `json:"dropins,omitempty" yaml:"dropins,omitempty"`
	Enable   bool            `json:"enable,omitempty" yaml:"enable,omitempty"`
	Enabled  *bool           `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	Mask     bool            `json:"mask,omitempty" yaml:"mask,omitempty"`
	Name     string          `json:"name,omitempty" yaml:"name,omitempty"`
}

type Usercreate

type Usercreate struct {
	Gecos        string            `json:"gecos,omitempty" yaml:"gecos,omitempty"`
	Groups       []UsercreateGroup `json:"groups,omitempty" yaml:"groups,omitempty"`
	HomeDir      string            `json:"homeDir,omitempty" yaml:"homeDir,omitempty"`
	NoCreateHome bool              `json:"noCreateHome,omitempty" yaml:"noCreateHome,omitempty"`
	NoLogInit    bool              `json:"noLogInit,omitempty" yaml:"noLogInit,omitempty"`
	NoUserGroup  bool              `json:"noUserGroup,omitempty" yaml:"noUserGroup,omitempty"`
	PrimaryGroup string            `json:"primaryGroup,omitempty" yaml:"primaryGroup,omitempty"`
	Shell        string            `json:"shell,omitempty" yaml:"shell,omitempty"`
	System       bool              `json:"system,omitempty" yaml:"system,omitempty"`
	UID          *int              `json:"uid,omitempty" yaml:"uid,omitempty"`
}

type UsercreateGroup

type UsercreateGroup string

type Verification

type Verification struct {
	Hash *string `json:"hash,omitempty" yaml:"hash,omitempty"`
}

Jump to

Keyboard shortcuts

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