2018-12-10 07:28:24 +00:00
|
|
|
package localconfig
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
yaml "gopkg.in/yaml.v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Host struct {
|
|
|
|
Name string
|
2019-12-11 12:08:16 +00:00
|
|
|
|
2019-12-11 12:08:16 +00:00
|
|
|
Labels map[string]string
|
|
|
|
Annotations map[string]string
|
2019-12-11 12:08:16 +00:00
|
|
|
|
2018-12-10 07:28:24 +00:00
|
|
|
MACs []string
|
|
|
|
IPs []string
|
|
|
|
|
2018-12-10 10:52:14 +00:00
|
|
|
IPXE string
|
2018-12-10 07:28:24 +00:00
|
|
|
|
2018-12-10 10:52:14 +00:00
|
|
|
Kernel string
|
|
|
|
Initrd string
|
|
|
|
Versions map[string]string
|
|
|
|
|
|
|
|
Config string
|
2018-12-10 07:28:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (h *Host) WriteHashDataTo(w io.Writer) error {
|
|
|
|
return yaml.NewEncoder(w).Encode(Host{
|
2018-12-10 10:52:14 +00:00
|
|
|
Kernel: h.Kernel,
|
|
|
|
Initrd: h.Initrd,
|
|
|
|
Versions: h.Versions,
|
|
|
|
Config: h.Config,
|
2019-12-11 12:08:16 +00:00
|
|
|
|
|
|
|
Labels: map[string]string{},
|
|
|
|
Annotations: map[string]string{},
|
2018-12-10 07:28:24 +00:00
|
|
|
})
|
|
|
|
}
|