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.
44 lines
734 B
44 lines
734 B
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) |
|
}
|
|
|