Documentation
¶
Overview ¶
Package facts provides facts about the system
Index ¶
- Variables
- func DistroAlpine() bool
- func DistroArch() bool
- func DistroFedora() bool
- func DistroRHEL() bool
- func DistroUbuntu() bool
- func GetCPUInfo()
- func GetCephLVMVolumes() (map[string][]CephLVMVolume, error)
- func GetStorageFactsInfo()
- func GetSystemUUID() string
- type CPUInfoFacts
- type CephFacts
- type CephLVMVolume
- type CephOSD
- type CephVolumeTags
- type DiskInfo
- type DistroFacts
- type NetworkFacts
- type ServiceFacts
- type StorageFacts
Constants ¶
This section is empty.
Variables ¶
var Facts facts
Facts holds facts about the system
Functions ¶
func DistroFedora ¶
func DistroFedora() bool
DistroFedora - return true if we are on a Fedora distro
func DistroRHEL ¶
func DistroRHEL() bool
DistroRHEL - return true if we are on a Red Hat Enterprise Linux distro
func DistroUbuntu ¶
func DistroUbuntu() bool
DistroUbuntu - return true if we are on a Ubuntu distro
func GetCephLVMVolumes ¶
func GetCephLVMVolumes() (map[string][]CephLVMVolume, error)
GetCephLVMVolumes retrieves Ceph LVM volume information
func GetStorageFactsInfo ¶
func GetStorageFactsInfo()
func GetSystemUUID ¶
func GetSystemUUID() string
GetSystemUUID - return/fill in the system UUID TODO if we can't find one, generate our own and store it in our cache dir
Types ¶
type CPUInfoFacts ¶
type CPUInfoFacts struct {
Arch string // amd64/etc
ArchArch string // x86_64/etc (i.e. the output you'd get from the arch binary)
FeatureLevel string // v1/v2/v3/v4 equivalent to $GOAMD64 TODO
Vendor string
Model string
Cores int
Threads int
Flags []string
}
CPUInfoFacts - info about the CPU(s) in the system
type CephFacts ¶
type CephFacts struct {
LVMVolumes map[string][]CephLVMVolume // Map of OSD ID to volumes
OSDs []CephOSD // Parsed OSD information
}
CephFacts contains facts about Ceph storage
type CephLVMVolume ¶
type CephLVMVolume struct {
Devices []string `json:"devices"`
LVName string `json:"lv_name"`
LVPath string `json:"lv_path"`
LVSize string `json:"lv_size"`
LVTags string `json:"lv_tags"`
LVUUID string `json:"lv_uuid"`
Name string `json:"name"`
Path string `json:"path"`
Tags CephVolumeTags `json:"tags"`
Type string `json:"type"`
VGName string `json:"vg_name"`
}
CephLVMVolume represents a single LVM volume used by Ceph
type CephOSD ¶
type CephOSD struct {
ID int
Volumes []CephLVMVolume
}
CephOSD represents a Ceph OSD and its associated volumes
func (*CephOSD) GetBlockVolume ¶
func (osd *CephOSD) GetBlockVolume() *CephLVMVolume
GetBlockVolume returns the block volume for an OSD (if it exists)
func (*CephOSD) GetDBVolume ¶
func (osd *CephOSD) GetDBVolume() *CephLVMVolume
GetDBVolume returns the DB volume for an OSD (if it exists)
func (*CephOSD) GetWALVolume ¶
func (osd *CephOSD) GetWALVolume() *CephLVMVolume
GetWALVolume returns the WAL volume for an OSD (if it exists)
type CephVolumeTags ¶
type CephVolumeTags struct {
BlockDevice string `json:"ceph.block_device"`
BlockUUID string `json:"ceph.block_uuid"`
CephxLockboxSecret string `json:"ceph.cephx_lockbox_secret"`
ClusterFSID string `json:"ceph.cluster_fsid"`
ClusterName string `json:"ceph.cluster_name"`
CrushDeviceClass string `json:"ceph.crush_device_class"`
DBDevice string `json:"ceph.db_device"`
DBUUID string `json:"ceph.db_uuid"`
Encrypted string `json:"ceph.encrypted"`
OSDFSID string `json:"ceph.osd_fsid"`
OSDID string `json:"ceph.osd_id"`
OSDSpecAffinity string `json:"ceph.osdspec_affinity"`
Type string `json:"ceph.type"`
VDO string `json:"ceph.vdo"`
WALDevice string `json:"ceph.wal_device"`
WALUUID string `json:"ceph.wal_uuid"`
}
CephVolumeTags contains parsed Ceph tags from LVM volumes
type DistroFacts ¶
type DistroFacts struct {
Name string
Slug string
Family string
Version string
Codename string
InitSystem string
}
DistroFacts - holds distro information
type NetworkFacts ¶
type NetworkFacts struct {
// TODO
// HasEthernet bool // can be used to only install ethernet packages on systems with ethernet, etc
// HasFibre?
// HasWifi?
// HasBluetooth?
Interfaces []net.Interface
}
NetworkFacts contains facts about the network
type ServiceFacts ¶
ServiceFacts contains facts about the system services
type StorageFacts ¶
type StorageFacts struct {
LocalDisks []DiskInfo // list of local disks
}
func (*StorageFacts) GetRoot ¶
func (f *StorageFacts) GetRoot() (*DiskInfo, error)