You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
734 B
45 lines
734 B
1 year ago
|
package cluster
|
||
1 year ago
|
|
||
|
// SyncAll updates all config files
|
||
|
func (m *Zones) SyncAll() error {
|
||
|
for _, fn := range []func() error{
|
||
|
m.SyncAllWireguard,
|
||
1 year ago
|
m.SyncAllCeph,
|
||
1 year ago
|
} {
|
||
|
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++ {
|
||
1 year ago
|
err = m.WriteWireguardKeys(ring)
|
||
1 year ago
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
1 year ago
|
err = m.SyncWireguardConfig(ring)
|
||
1 year ago
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
1 year ago
|
|
||
|
// SyncAllCeph updates the ceph.conf file
|
||
|
func (m *Zones) SyncAllCeph() error {
|
||
|
cfg, err := m.GenCephConfig()
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return m.WriteCephConfig(cfg)
|
||
|
}
|