cluster: rename pkg/zones to pkg/cluster

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-09-10 19:01:36 +00:00
parent 046c9a508b
commit 5abb4c2f92
19 changed files with 33 additions and 31 deletions
+44
View File
@@ -0,0 +1,44 @@
package cluster
// SyncAll updates all config files
func (m *Zones) SyncAll() error {
for _, fn := range []func() error{
m.SyncAllWireguard,
m.SyncAllCeph,
} {
if err := fn(); err != nil {
return err
}
}
return nil
}
// SyncAllWireguard updates all wireguard config files
func (m *Zones) SyncAllWireguard() error {
var err error
for ring := 0; ring < RingsCount; ring++ {
err = m.WriteWireguardKeys(ring)
if err != nil {
return err
}
err = m.SyncWireguardConfig(ring)
if err != nil {
return err
}
}
return nil
}
// SyncAllCeph updates the ceph.conf file
func (m *Zones) SyncAllCeph() error {
cfg, err := m.GenCephConfig()
if err != nil {
return err
}
return m.WriteCephConfig(cfg)
}