Documentation
¶
Index ¶
- Constants
- func AddGroup(name string) error
- func AddMounts(mounts []*api.Mount) error
- func AddSshAuthorizedKeys(user string, keys []string) error
- func AddUser(name, passwd string) error
- func AddUserToGroup(name, group string) error
- func Error(message string) error
- func ErrorE(message string, err error) error
- func ErrorEF(message string, err error, fields log.Fields) error
- func ErrorF(message string, fields log.Fields) error
- func Forge(mc *api.MachineConfig) error
- func ForgeHostname(hostname string) error
- func ForgeInterfaces(interfaces []*api.Interface) error
- func ForgePhy(ifx *api.Interface) error
- func ForgeRootfs() error
- func ForgeRoutes() error
- func ForgeStaticRoutes(routes []*api.Route, interfaces []*api.Interface) error
- func ForgeUsers(users []*api.User) error
- func ForgeVlan(ifx *api.Interface) error
- func ForgeVxlan(ifx *api.Interface) error
- func GetIds() ([]string, error)
- func ValidateAddress(addr string) bool
- func ValidateDHCP(dhcp string) bool
- type FSTab
- type FSTabFile
- type PosixUser
- type SystemdConfig
- func (c SystemdConfig) MatchName(name string)
- func (c SystemdConfig) Netdev(name, kind string)
- func (c SystemdConfig) NetdevVlan(vid int)
- func (c SystemdConfig) PushSection(section string)
- func (c SystemdConfig) SetAddress(value string)
- func (c SystemdConfig) SetDHCP(value string)
- func (c SystemdConfig) SetEntry(section, name, value string)
- func (c SystemdConfig) SetMtu(value int)
- func (c SystemdConfig) SetVlan(name string, vid int)
- func (c SystemdConfig) Write(name, kind string) error
Constants ¶
const ( WireguardSubnet = "192.168.254.0/24" //TODO get from foundryd InfranetGateway = "172.30.0.1" )
Variables ¶
This section is empty.
Functions ¶
func AddSshAuthorizedKeys ¶
func AddUserToGroup ¶
func ErrorE ¶
Encapsulate err in a structured log and return an abstracted high-level error with message as the payload
func ErrorEF ¶
Encapsulate fields and err in a structured log and return an abstracted high-level error with message as the payload
func ErrorF ¶
Encapsulate fields in a structured log and return an abstracted high-level error with message as the payload
func Forge ¶
func Forge(mc *api.MachineConfig) error
Forge is the top level function responsible for implementing "forging" a set of foundry instructions onto a node
func ForgeHostname ¶ added in v0.1.5
func ForgeInterfaces ¶
func ForgeRootfs ¶ added in v0.1.8
func ForgeRootfs() error
func ForgeRoutes ¶ added in v0.1.13
func ForgeRoutes() error
func ForgeStaticRoutes ¶ added in v0.1.13
func ForgeUsers ¶
func ValidateAddress ¶
func ValidateDHCP ¶ added in v0.1.11
Types ¶
type FSTabFile ¶ added in v0.1.11
type FSTabFile struct {
// Entries is a linux user to FsTab Entry, the user key, tells us how to chown the directory
// username: /mnt, /dev, ...
Entries map[string][]*FSTab
}
FSTabFile wraps all the FSTab entries in /etc/fstab
func (*FSTabFile) AddFSTabEntry ¶ added in v0.1.11
AddFSTabEntry places entries into fstab for durability
func (*FSTabFile) FSTabParse ¶ added in v0.1.11
FSTabParse parses fstab file
func (*FSTabFile) FSTabWrite ¶ added in v0.1.11
FSTabWrite writes out the fstab file
func (*FSTabFile) FindEntryByDevice ¶ added in v0.1.11
FindEntryByDevice checks fstab file for an entry using specified device
type PosixUser ¶
func GetPosixUser ¶
type SystemdConfig ¶
type SystemdConfig map[string][]*unit.UnitSection
SystemdConfig keeps track of the UnitSections we are writing and updating.
func Read ¶ added in v0.1.6
func Read(filename string) (SystemdConfig, error)
Read and parse the given unit file into a SystemdConfig instance.
func (SystemdConfig) MatchName ¶
func (c SystemdConfig) MatchName(name string)
MatchName creates Match Name unit file entry.
func (SystemdConfig) Netdev ¶ added in v0.1.6
func (c SystemdConfig) Netdev(name, kind string)
Netdev creates two unit file NetDev entries, Name and Kind.
func (SystemdConfig) NetdevVlan ¶ added in v0.1.6
func (c SystemdConfig) NetdevVlan(vid int)
NetdevVlan creates a VLAN Id unit file entry.
func (SystemdConfig) PushSection ¶ added in v0.1.13
func (c SystemdConfig) PushSection(section string)
PushSection starts a new section. Any SetEntries will be applied to the new section.
func (SystemdConfig) SetAddress ¶
func (c SystemdConfig) SetAddress(value string)
SetAddress creates a Network Address unit file entry.
func (SystemdConfig) SetDHCP ¶ added in v0.1.11
func (c SystemdConfig) SetDHCP(value string)
SetDHCP configues systemd-networkd's dhcp value
func (SystemdConfig) SetEntry ¶
func (c SystemdConfig) SetEntry(section, name, value string)
SetEntry appends the given name, value pair to newest section given.
func (SystemdConfig) SetMtu ¶ added in v0.1.6
func (c SystemdConfig) SetMtu(value int)
SetMtu creates a Link MTUBytes unit file entry.
func (SystemdConfig) SetVlan ¶ added in v0.1.6
func (c SystemdConfig) SetVlan(name string, vid int)
SetVlan creates a Network VLAN unti file entry.
func (SystemdConfig) Write ¶
func (c SystemdConfig) Write(name, kind string) error
Write the current unit file entries to the appropriate Network config file.