jpictl: create machine directories on jpictl write
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -3,6 +3,7 @@ package cluster
|
|||||||
// SyncAll updates all config files
|
// SyncAll updates all config files
|
||||||
func (m *Cluster) SyncAll() error {
|
func (m *Cluster) SyncAll() error {
|
||||||
for _, fn := range []func() error{
|
for _, fn := range []func() error{
|
||||||
|
m.SyncMkdirAll,
|
||||||
m.SyncAllWireguard,
|
m.SyncAllWireguard,
|
||||||
m.SyncAllCeph,
|
m.SyncAllCeph,
|
||||||
m.WriteHosts,
|
m.WriteHosts,
|
||||||
@@ -15,6 +16,20 @@ func (m *Cluster) SyncAll() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SyncMkdirAll creates the directories needed to store files
|
||||||
|
// required to represent the cluster.
|
||||||
|
func (m *Cluster) SyncMkdirAll() error {
|
||||||
|
err := m.MkdirAll(".")
|
||||||
|
if err == nil {
|
||||||
|
m.ForEachMachine(func(p *Machine) bool {
|
||||||
|
err = p.MkdirAll(".")
|
||||||
|
return err != nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// SyncAllWireguard updates all wireguard config files
|
// SyncAllWireguard updates all wireguard config files
|
||||||
func (m *Cluster) SyncAllWireguard() error {
|
func (m *Cluster) SyncAllWireguard() error {
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
Reference in New Issue
Block a user