warewulf

package
v0.0.0-...-a4fc1f2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2019 License: GPL-2.0-or-later Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IdFromString

func IdFromString(id string) wwObjId

func LoadYamlFile

func LoadYamlFile(filePath string, result interface{}) error

func ObjJsonDump

func ObjJsonDump(args ...string) ([]wwObj, error)

func ParseJsonDump

func ParseJsonDump(output []byte) ([]wwObj, error)

func StringListEquals

func StringListEquals(l1, l2 []string) (bool, string)

Types

type Bootstrap

type Bootstrap struct {
	Name   string `yaml:"name"`
	Source string `yaml:"source"`
}

func NewBootstrapFromWWObject

func NewBootstrapFromWWObject(obj map[string]interface{}) *Bootstrap

func (*Bootstrap) DeleteCmd

func (b *Bootstrap) DeleteCmd() [][]string

func (*Bootstrap) Equals

func (b *Bootstrap) Equals(other interface{}) (bool, string)

func (*Bootstrap) IdString

func (b *Bootstrap) IdString() string

func (*Bootstrap) NewCmd

func (b *Bootstrap) NewCmd() [][]string

func (*Bootstrap) UpdateCmd

func (b *Bootstrap) UpdateCmd() [][]string

type DB

type DB struct {
	Nodes      map[string]*Node
	Files      map[string]*File
	Vnfs       map[string]*Vnfs
	Bootstraps map[string]*Bootstrap
	Roles      map[string]*Role
}

func LoadWwshDB

func LoadWwshDB() (*DB, error)

func LoadYaml

func LoadYaml(yamlPath string) (*DB, error)

func NewDB

func NewDB() *DB

func (*DB) LoadNodesFromInventory

func (db *DB) LoadNodesFromInventory(inv InventoryNodeGetter, system string) error

func (*DB) String

func (db *DB) String() string

type File

type File struct {
	Name        string
	Source      string
	Destination string
	Mode        int
	Owner       int
	Group       int
}

func NewFileFromWWObject

func NewFileFromWWObject(obj map[string]interface{}) *File

func (*File) DeleteCmd

func (f *File) DeleteCmd() [][]string

func (*File) Equals

func (f *File) Equals(other interface{}) (bool, string)

func (*File) GIDString

func (f *File) GIDString() string

func (*File) IdString

func (f *File) IdString() string

func (*File) NewCmd

func (f *File) NewCmd() [][]string

func (*File) ResolveRelativePaths

func (f *File) ResolveRelativePaths(base string)

func (*File) UIDString

func (f *File) UIDString() string

func (*File) UpdateCmd

func (f *File) UpdateCmd() [][]string

type InventoryNodeGetter

type InventoryNodeGetter interface {
	GetAll() ([]*types.InventoryNode, error)
}

type NetDev

type NetDev struct {
	Interface string `yaml:"interface"`
	Ip        string `yaml:"ip"`
	HwAddr    string `yaml:"mac"`
	MTU       string `yaml:"mtu"`
	Netmask   string
	Gateway   string
}

func (*NetDev) Equals

func (n *NetDev) Equals(other interface{}) (bool, string)

type NetDevList

type NetDevList []*NetDev

func (NetDevList) Equals

func (l NetDevList) Equals(other interface{}) (bool, string)

type Node

type Node struct {
	Name         string     `yaml:"hostname"`
	Interfaces   NetDevList `yaml:"interfaces"`
	RoleName     string     `yaml:"role"`
	Console      string     `yaml:"console"`
	PxeLoader    string     `yaml:"pxeloader"`
	IPxeUrl      string     `yaml:ipxeurl`
	PostNetDown  bool       `yaml:"postnetdown"`
	Role         *Role      `yaml:"-"`
	Master       string     `yaml:"master"`
	LastModified *time.Time `yaml:"last_modified"`
}

func NewNodeFromWWObject

func NewNodeFromWWObject(obj map[string]interface{}, fileIndex, bootstrapIndex, vnfsIndex idNameMap) *Node

func (*Node) DeleteCmd

func (n *Node) DeleteCmd() [][]string

func (*Node) Equals

func (n *Node) Equals(other interface{}) (bool, string)

func (*Node) IdString

func (n *Node) IdString() string

func (*Node) NewCmd

func (n *Node) NewCmd() [][]string

func (*Node) UpdateCmd

func (n *Node) UpdateCmd() [][]string

type Role

type Role struct {
	Name          string
	VnfsName      string   `yaml:"vnfs"`
	BootstrapName string   `yaml:"bootstrap"`
	FileNames     []string `yaml:"files"`
	Groups        []string
}

func (*Role) Equals

func (r *Role) Equals(other interface{}) (bool, string)

func (*Role) IdString

func (r *Role) IdString() string

type RoleList

type RoleList []*Role

func (RoleList) RequiredObjectsOnly

func (r RoleList) RequiredObjectsOnly(db *DB) (*DB, error)

type Vnfs

type Vnfs struct {
	Name   string `yaml:"name"`
	Source string `yaml:"source"`
}

func NewVnfsFromWWObject

func NewVnfsFromWWObject(obj map[string]interface{}) *Vnfs

func (*Vnfs) DeleteCmd

func (v *Vnfs) DeleteCmd() [][]string

func (*Vnfs) Equals

func (v *Vnfs) Equals(other interface{}) (bool, string)

func (*Vnfs) IdString

func (v *Vnfs) IdString() string

func (*Vnfs) NewCmd

func (v *Vnfs) NewCmd() [][]string

func (*Vnfs) UpdateCmd

func (v *Vnfs) UpdateCmd() [][]string

Jump to

Keyboard shortcuts

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