cmd

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const HammerBanner = `` /* 212-byte string literal not displayed */

HammerBanner our mighty logo.

Variables

This section is empty.

Functions

func Run

func Run(spec *Specification) (*event.EventEmitter, error)

Run orchestrates the whole register/wipe/format/burn and reboot process

func StartSSHD

func StartSSHD(ip string) error

StartSSHD will start sshd to be able to diagnose problems on the pxe bootet machine.

Types

type Hammer

type Hammer struct {
	Client     *machine.Client
	Spec       *Specification
	Disk       storage.Disk
	LLDPClient *network.LLDPClient
	// IPAddress is the ip of the eth0 interface during installation
	IPAddress          string
	Started            time.Time
	EventEmitter       *event.EventEmitter
	ChrootPrefix       string
	OsImageDestination string
}

Hammer is the machine which forms a bare metal to a working server

func (*Hammer) EnsureBootOrder

func (h *Hammer) EnsureBootOrder(bootloaderID string) error

EnsureBootOrder ensures that the BIOS boot order is properly set, i.e. first boot from OS image and then PXE boot. Will be skipped in dev mode.

func (*Hammer) EnsureUEFI

func (h *Hammer) EnsureUEFI() error

EnsureUEFI ensures that UEFI boot is enabled and reboots the machine if required and not in dev mode.

func (*Hammer) Install

Install a given image to the disk by using genuinetools/img

func (*Hammer) Wait

func (h *Hammer) Wait(uuid string) (*models.ModelsV1MachineResponse, error)

Wait until a machine create request was fired

type InstallerConfig

type InstallerConfig struct {
	// Hostname of the machine
	Hostname string `yaml:"hostname"`
	// Networks all networks connected to this machine
	Networks []*models.ModelsV1MachineNetwork `yaml:"networks"`
	// MachineUUID is the unique UUID for this machine, usually the board serial.
	MachineUUID string `yaml:"machineuuid"`
	// SSHPublicKey of the user
	SSHPublicKey string `yaml:"sshpublickey"`
	// Password is the password for the metal user.
	Password string `yaml:"password"`
	// Devmode passes mode of installation.
	Devmode bool `yaml:"devmode"`
	// Console specifies where the kernel should connect its console to.
	Console string `yaml:"console"`
	// Timestamp is the the timestamp of installer config creation.
	Timestamp string `yaml:"timestamp"`
	// Nics are the network interfaces of this machine including their neighbors.
	Nics []*models.ModelsV1MachineNicExtended `yaml:"nics"`
}

InstallerConfig contains configuration items which are consumed by the install.sh of the individual target OS.

type Specification

type Specification struct {
	// Debug turn on debug log
	Debug bool
	// MetalCoreURL is the endpoint URL where the metalcore reside
	MetalCoreURL string
	// ImageURL if given grabs a fixed OS image to install, only suitable in DevMode
	ImageURL string
	// ImageID if given defines the image.ID which normally comes from a allocation
	// can be something like ubuntu-18.04, alpine-3.9 or "default"
	// only suitable in DevMode
	ImageID string
	// SizeID if given defines the size.ID which normally comes from a allocation
	// can be something like v1-small-x86
	// only suitable in DevMode
	SizeID string
	// DevMode turn on devmode which prevents failing in some situations
	DevMode bool
	// BGPEnabled if set to true real bgp configuration is configured, otherwise dhcp will be used
	BGPEnabled bool
	// Cidr of BGP interface in DEV Mode
	Cidr string
	// ConsolePassword of the metal user valid for one day.
	ConsolePassword string
	// MachineUUID is the unique identifier of this machine
	MachineUUID string
	// IP of this instance
	IP string
}

Specification defines configuration items of the application

func NewSpec

func NewSpec(ip string) *Specification

NewSpec fills Specification with configuration made by kernel commandline

func (*Specification) Log

func (s *Specification) Log()

Log print configuration options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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