Documentation
¶
Index ¶
- Constants
- func FileExists(fs *afero.Afero, filename string) bool
- type CommonTasks
- func (d *CommonTasks) BootloaderID() string
- func (d *CommonTasks) BuildCMDLine(ctx context.Context) (string, error)
- func (d *CommonTasks) ConfigureNetwork(ctx context.Context) error
- func (d *CommonTasks) CopySSHKeys(ctx context.Context) error
- func (d *CommonTasks) CreateMetalUser(ctx context.Context, sudoGroup string) error
- func (d *CommonTasks) FigureOutSerialSpeed() (serialPort, serialSpeed string, err error)
- func (d *CommonTasks) FixPermissions(ctx context.Context) error
- func (d *CommonTasks) GetKernelVersion(initramdiskFormatString string) (string, error)
- func (d *CommonTasks) GrubInstall(ctx context.Context, bootloaderID, cmdLine string) error
- func (d *CommonTasks) InitramdiskFormatString() string
- func (d *CommonTasks) KernelAndInitrdPath(initramdiskFormatString string) (kern string, initrd string, err error)
- func (d *CommonTasks) ProcessUserdata(ctx context.Context) error
- func (d *CommonTasks) SudoGroup() string
- func (d *CommonTasks) SystemdServices(ctx context.Context) error
- func (d *CommonTasks) UnsetMachineID(ctx context.Context) error
- func (d *CommonTasks) WriteBootInfo(ctx context.Context, initramdiskFormatString, bootloaderID, cmdLine string) error
- func (d *CommonTasks) WriteBuildMeta(ctx context.Context) error
- func (d *CommonTasks) WriteHostname(ctx context.Context) error
- func (d *CommonTasks) WriteHosts(ctx context.Context) error
- func (d *CommonTasks) WriteNTPConf(ctx context.Context) error
- func (d *CommonTasks) WriteNtpConfToPath(configPath string, ntpServers []string) error
- func (d *CommonTasks) WriteResolvConf(ctx context.Context) error
- type Config
- type DefaultOS
- type LookupUserFn
- type OperatingSystem
Constants ¶
View Source
const ( EtcMachineID = "/etc/machine-id" DbusMachineID = "/var/lib/dbus/machine-id" )
View Source
const (
DefaultGrubPath = "/etc/default/grub"
)
View Source
const (
EtcHostsPath = "/etc/hosts"
)
View Source
const (
HostnameFilePath = "/etc/hostname"
)
View Source
const (
MetalUser = "metal"
)
View Source
const (
ResolvConfPath = "/etc/resolv.conf"
)
View Source
const (
TimesyncdConfigPath = "/etc/systemd/timesyncd.conf"
)
View Source
const (
UserdataPath = "/etc/metal/userdata"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommonTasks ¶
type CommonTasks struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg *Config) *CommonTasks
func (*CommonTasks) BootloaderID ¶
func (d *CommonTasks) BootloaderID() string
func (*CommonTasks) BuildCMDLine ¶
func (d *CommonTasks) BuildCMDLine(ctx context.Context) (string, error)
func (*CommonTasks) ConfigureNetwork ¶
func (d *CommonTasks) ConfigureNetwork(ctx context.Context) error
func (*CommonTasks) CopySSHKeys ¶
func (d *CommonTasks) CopySSHKeys(ctx context.Context) error
func (*CommonTasks) CreateMetalUser ¶
func (d *CommonTasks) CreateMetalUser(ctx context.Context, sudoGroup string) error
func (*CommonTasks) FigureOutSerialSpeed ¶
func (d *CommonTasks) FigureOutSerialSpeed() (serialPort, serialSpeed string, err error)
func (*CommonTasks) FixPermissions ¶
func (d *CommonTasks) FixPermissions(ctx context.Context) error
func (*CommonTasks) GetKernelVersion ¶
func (d *CommonTasks) GetKernelVersion(initramdiskFormatString string) (string, error)
func (*CommonTasks) GrubInstall ¶
func (d *CommonTasks) GrubInstall(ctx context.Context, bootloaderID, cmdLine string) error
func (*CommonTasks) InitramdiskFormatString ¶
func (d *CommonTasks) InitramdiskFormatString() string
func (*CommonTasks) KernelAndInitrdPath ¶
func (d *CommonTasks) KernelAndInitrdPath(initramdiskFormatString string) (kern string, initrd string, err error)
func (*CommonTasks) ProcessUserdata ¶
func (d *CommonTasks) ProcessUserdata(ctx context.Context) error
func (*CommonTasks) SudoGroup ¶
func (d *CommonTasks) SudoGroup() string
func (*CommonTasks) SystemdServices ¶
func (d *CommonTasks) SystemdServices(ctx context.Context) error
func (*CommonTasks) UnsetMachineID ¶
func (d *CommonTasks) UnsetMachineID(ctx context.Context) error
func (*CommonTasks) WriteBootInfo ¶
func (d *CommonTasks) WriteBootInfo(ctx context.Context, initramdiskFormatString, bootloaderID, cmdLine string) error
func (*CommonTasks) WriteBuildMeta ¶
func (d *CommonTasks) WriteBuildMeta(ctx context.Context) error
func (*CommonTasks) WriteHostname ¶
func (d *CommonTasks) WriteHostname(ctx context.Context) error
func (*CommonTasks) WriteHosts ¶
func (d *CommonTasks) WriteHosts(ctx context.Context) error
func (*CommonTasks) WriteNTPConf ¶
func (d *CommonTasks) WriteNTPConf(ctx context.Context) error
func (*CommonTasks) WriteNtpConfToPath ¶
func (d *CommonTasks) WriteNtpConfToPath(configPath string, ntpServers []string) error
func (*CommonTasks) WriteResolvConf ¶
func (d *CommonTasks) WriteResolvConf(ctx context.Context) error
type Config ¶
type Config struct {
Log *slog.Logger
Fs *afero.Afero
Exec *exec.CmdExecutor
MachineDetails *v1.MachineDetails
Allocation *apiv2.MachineAllocation
LookupUserFn LookupUserFn
// customization options from installer config
Name *string
BootloaderID *string
}
type DefaultOS ¶
type DefaultOS struct {
*CommonTasks
// contains filtered or unexported fields
}
func NewDefaultOS ¶
func (*DefaultOS) BootloaderID ¶
func (*DefaultOS) GrubInstall ¶
type OperatingSystem ¶
type OperatingSystem interface {
WriteHostname(ctx context.Context) error
WriteHosts(ctx context.Context) error
WriteResolvConf(ctx context.Context) error
WriteNTPConf(ctx context.Context) error
CreateMetalUser(ctx context.Context) error
ConfigureNetwork(ctx context.Context) error
CopySSHKeys(ctx context.Context) error
FixPermissions(ctx context.Context) error
ProcessUserdata(ctx context.Context) error
BuildCMDLine(ctx context.Context) (string, error)
WriteBootInfo(ctx context.Context, cmdLine string) error
GrubInstall(ctx context.Context, cmdLine string) error
UnsetMachineID(ctx context.Context) error
SystemdServices(ctx context.Context) error
WriteBuildMeta(ctx context.Context) error
SudoGroup() string
InitramdiskFormatString() string
BootloaderID() string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.