This commit is contained in:
2025-08-29 09:47:54 +02:00
parent b29468c0c2
commit b146261432
46 changed files with 295 additions and 278 deletions

View File

@@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! {
return error("can't configure actrunner, because no configuration allowed for this installer.")
}
mut other_actions := plbook.find(filter: 'actrunner.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -68,6 +68,7 @@ pub fn play(mut plbook PlayBook) ! {
actrunner_obj.restart()!
}
}
other_action.done = true
}
}
@@ -83,19 +84,19 @@ fn startupmanager_get(cat startupmanager.StartupManagerType) !startupmanager.Sta
// systemd
match cat {
.screen {
console.print_debug('startupmanager: screen')
console.print_debug("installer: actrunner' startupmanager get screen")
return startupmanager.get(.screen)!
}
.zinit {
console.print_debug('startupmanager: zinit')
console.print_debug("installer: actrunner' startupmanager get zinit")
return startupmanager.get(.zinit)!
}
.systemd {
console.print_debug('startupmanager: systemd')
console.print_debug("installer: actrunner' startupmanager get systemd")
return startupmanager.get(.systemd)!
}
else {
console.print_debug('startupmanager: auto')
console.print_debug("installer: actrunner' startupmanager get auto")
return startupmanager.get(.auto)!
}
}
@@ -106,7 +107,7 @@ pub fn (mut self ActRunner) start() ! {
return
}
console.print_header('actrunner start')
console.print_header('installer: actrunner start')
if !installed()! {
install()!
@@ -119,7 +120,7 @@ pub fn (mut self ActRunner) start() ! {
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
console.print_debug('starting actrunner with ${zprocess.startuptype}...')
console.print_debug('installer: actrunner starting with ${zprocess.startuptype}...')
sm.new(zprocess)!

View File

@@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! {
return error("can't configure b2, because no configuration allowed for this installer.")
}
mut other_actions := plbook.find(filter: 'b2.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -48,6 +48,7 @@ pub fn play(mut plbook PlayBook) ! {
install()!
}
}
other_action.done = true
}
}

View File

@@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! {
return error("can't configure fungistor, because no configuration allowed for this installer.")
}
mut other_actions := plbook.find(filter: 'fungistor.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -68,6 +68,7 @@ pub fn play(mut plbook PlayBook) ! {
fungistor_obj.restart()!
}
}
other_action.done = true
}
}
@@ -83,19 +84,19 @@ fn startupmanager_get(cat startupmanager.StartupManagerType) !startupmanager.Sta
// systemd
match cat {
.screen {
console.print_debug('startupmanager: screen')
console.print_debug("installer: fungistor' startupmanager get screen")
return startupmanager.get(.screen)!
}
.zinit {
console.print_debug('startupmanager: zinit')
console.print_debug("installer: fungistor' startupmanager get zinit")
return startupmanager.get(.zinit)!
}
.systemd {
console.print_debug('startupmanager: systemd')
console.print_debug("installer: fungistor' startupmanager get systemd")
return startupmanager.get(.systemd)!
}
else {
console.print_debug('startupmanager: auto')
console.print_debug("installer: fungistor' startupmanager get auto")
return startupmanager.get(.auto)!
}
}
@@ -106,7 +107,7 @@ pub fn (mut self FungiStor) start() ! {
return
}
console.print_header('fungistor start')
console.print_header('installer: fungistor start')
if !installed()! {
install()!
@@ -119,7 +120,7 @@ pub fn (mut self FungiStor) start() ! {
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
console.print_debug('starting fungistor with ${zprocess.startuptype}...')
console.print_debug('installer: fungistor starting with ${zprocess.startuptype}...')
sm.new(zprocess)!

View File

@@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&GarageS3 {
if r.hexists('context:garage_s3', args.name)! {
data := r.hget('context:garage_s3', args.name)!
if data.len == 0 {
print_backtrace()
return error('GarageS3 with name: garage_s3 does not exist, prob bug.')
}
mut obj := json.decode(GarageS3, data)!
@@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&GarageS3 {
if args.create {
new(args)!
} else {
print_backtrace()
return error("GarageS3 with name 'garage_s3' does not exist")
}
}
return get(name: args.name)! // no longer from db nor create
}
return garage_s3_global[args.name] or {
print_backtrace()
return error('could not get config for garage_s3 with name:garage_s3')
}
}
@@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! {
}
mut install_actions := plbook.find(filter: 'garage_s3.configure')!
if install_actions.len > 0 {
for install_action in install_actions {
for mut install_action in install_actions {
heroscript := install_action.heroscript()
mut obj2 := heroscript_loads(heroscript)!
set(obj2)!
install_action.done = true
}
}
mut other_actions := plbook.find(filter: 'garage_s3.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -163,6 +167,7 @@ pub fn play(mut plbook PlayBook) ! {
garage_s3_obj.restart()!
}
}
other_action.done = true
}
}
@@ -178,19 +183,19 @@ fn startupmanager_get(cat startupmanager.StartupManagerType) !startupmanager.Sta
// systemd
match cat {
.screen {
console.print_debug('startupmanager: screen')
console.print_debug("installer: garage_s3' startupmanager get screen")
return startupmanager.get(.screen)!
}
.zinit {
console.print_debug('startupmanager: zinit')
console.print_debug("installer: garage_s3' startupmanager get zinit")
return startupmanager.get(.zinit)!
}
.systemd {
console.print_debug('startupmanager: systemd')
console.print_debug("installer: garage_s3' startupmanager get systemd")
return startupmanager.get(.systemd)!
}
else {
console.print_debug('startupmanager: auto')
console.print_debug("installer: garage_s3' startupmanager get auto")
return startupmanager.get(.auto)!
}
}
@@ -208,7 +213,7 @@ pub fn (mut self GarageS3) start() ! {
return
}
console.print_header('garage_s3 start')
console.print_header('installer: garage_s3 start')
if !installed()! {
install()!
@@ -221,7 +226,7 @@ pub fn (mut self GarageS3) start() ! {
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
console.print_debug('starting garage_s3 with ${zprocess.startuptype}...')
console.print_debug('installer: garage_s3 starting with ${zprocess.startuptype}...')
sm.new(zprocess)!

View File

@@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! {
return error("can't configure grafana, because no configuration allowed for this installer.")
}
mut other_actions := plbook.find(filter: 'grafana.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -68,6 +68,7 @@ pub fn play(mut plbook PlayBook) ! {
grafana_obj.restart()!
}
}
other_action.done = true
}
}
@@ -83,19 +84,19 @@ fn startupmanager_get(cat startupmanager.StartupManagerType) !startupmanager.Sta
// systemd
match cat {
.screen {
console.print_debug('startupmanager: screen')
console.print_debug("installer: grafana' startupmanager get screen")
return startupmanager.get(.screen)!
}
.zinit {
console.print_debug('startupmanager: zinit')
console.print_debug("installer: grafana' startupmanager get zinit")
return startupmanager.get(.zinit)!
}
.systemd {
console.print_debug('startupmanager: systemd')
console.print_debug("installer: grafana' startupmanager get systemd")
return startupmanager.get(.systemd)!
}
else {
console.print_debug('startupmanager: auto')
console.print_debug("installer: grafana' startupmanager get auto")
return startupmanager.get(.auto)!
}
}
@@ -106,7 +107,7 @@ pub fn (mut self Grafana) start() ! {
return
}
console.print_header('grafana start')
console.print_header('installer: grafana start')
if !installed()! {
install()!
@@ -119,7 +120,7 @@ pub fn (mut self Grafana) start() ! {
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
console.print_debug('starting grafana with ${zprocess.startuptype}...')
console.print_debug('installer: grafana starting with ${zprocess.startuptype}...')
sm.new(zprocess)!

View File

@@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! {
return error("can't configure prometheus, because no configuration allowed for this installer.")
}
mut other_actions := plbook.find(filter: 'prometheus.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -68,6 +68,7 @@ pub fn play(mut plbook PlayBook) ! {
prometheus_obj.restart()!
}
}
other_action.done = true
}
}
@@ -83,19 +84,19 @@ fn startupmanager_get(cat startupmanager.StartupManagerType) !startupmanager.Sta
// systemd
match cat {
.screen {
console.print_debug('startupmanager: screen')
console.print_debug("installer: prometheus' startupmanager get screen")
return startupmanager.get(.screen)!
}
.zinit {
console.print_debug('startupmanager: zinit')
console.print_debug("installer: prometheus' startupmanager get zinit")
return startupmanager.get(.zinit)!
}
.systemd {
console.print_debug('startupmanager: systemd')
console.print_debug("installer: prometheus' startupmanager get systemd")
return startupmanager.get(.systemd)!
}
else {
console.print_debug('startupmanager: auto')
console.print_debug("installer: prometheus' startupmanager get auto")
return startupmanager.get(.auto)!
}
}
@@ -106,7 +107,7 @@ pub fn (mut self Prometheus) start() ! {
return
}
console.print_header('prometheus start')
console.print_header('installer: prometheus start')
if !installed()! {
install()!
@@ -119,7 +120,7 @@ pub fn (mut self Prometheus) start() ! {
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
console.print_debug('starting prometheus with ${zprocess.startuptype}...')
console.print_debug('installer: prometheus starting with ${zprocess.startuptype}...')
sm.new(zprocess)!

View File

@@ -37,6 +37,7 @@ pub fn get(args ArgsGet) !&RClone {
if r.hexists('context:rclone', args.name)! {
data := r.hget('context:rclone', args.name)!
if data.len == 0 {
print_backtrace()
return error('RClone with name: rclone does not exist, prob bug.')
}
mut obj := json.decode(RClone, data)!
@@ -45,12 +46,14 @@ pub fn get(args ArgsGet) !&RClone {
if args.create {
new(args)!
} else {
print_backtrace()
return error("RClone with name 'rclone' does not exist")
}
}
return get(name: args.name)! // no longer from db nor create
}
return rclone_global[args.name] or {
print_backtrace()
return error('could not get config for rclone with name:rclone')
}
}
@@ -123,14 +126,15 @@ pub fn play(mut plbook PlayBook) ! {
}
mut install_actions := plbook.find(filter: 'rclone.configure')!
if install_actions.len > 0 {
for install_action in install_actions {
for mut install_action in install_actions {
heroscript := install_action.heroscript()
mut obj2 := heroscript_loads(heroscript)!
set(obj2)!
install_action.done = true
}
}
mut other_actions := plbook.find(filter: 'rclone.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -143,6 +147,7 @@ pub fn play(mut plbook PlayBook) ! {
install()!
}
}
other_action.done = true
}
}

View File

@@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! {
return error("can't configure restic, because no configuration allowed for this installer.")
}
mut other_actions := plbook.find(filter: 'restic.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -68,6 +68,7 @@ pub fn play(mut plbook PlayBook) ! {
restic_obj.restart()!
}
}
other_action.done = true
}
}
@@ -83,19 +84,19 @@ fn startupmanager_get(cat startupmanager.StartupManagerType) !startupmanager.Sta
// systemd
match cat {
.screen {
console.print_debug('startupmanager: screen')
console.print_debug("installer: restic' startupmanager get screen")
return startupmanager.get(.screen)!
}
.zinit {
console.print_debug('startupmanager: zinit')
console.print_debug("installer: restic' startupmanager get zinit")
return startupmanager.get(.zinit)!
}
.systemd {
console.print_debug('startupmanager: systemd')
console.print_debug("installer: restic' startupmanager get systemd")
return startupmanager.get(.systemd)!
}
else {
console.print_debug('startupmanager: auto')
console.print_debug("installer: restic' startupmanager get auto")
return startupmanager.get(.auto)!
}
}
@@ -106,7 +107,7 @@ pub fn (mut self Restic) start() ! {
return
}
console.print_header('restic start')
console.print_header('installer: restic start')
if !installed()! {
install()!
@@ -119,7 +120,7 @@ pub fn (mut self Restic) start() ! {
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
console.print_debug('starting restic with ${zprocess.startuptype}...')
console.print_debug('installer: restic starting with ${zprocess.startuptype}...')
sm.new(zprocess)!

View File

@@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! {
return error("can't configure s3, because no configuration allowed for this installer.")
}
mut other_actions := plbook.find(filter: 's3.')!
for other_action in other_actions {
for mut other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
@@ -68,6 +68,7 @@ pub fn play(mut plbook PlayBook) ! {
s3_obj.restart()!
}
}
other_action.done = true
}
}
@@ -83,19 +84,19 @@ fn startupmanager_get(cat startupmanager.StartupManagerType) !startupmanager.Sta
// systemd
match cat {
.screen {
console.print_debug('startupmanager: screen')
console.print_debug("installer: s3' startupmanager get screen")
return startupmanager.get(.screen)!
}
.zinit {
console.print_debug('startupmanager: zinit')
console.print_debug("installer: s3' startupmanager get zinit")
return startupmanager.get(.zinit)!
}
.systemd {
console.print_debug('startupmanager: systemd')
console.print_debug("installer: s3' startupmanager get systemd")
return startupmanager.get(.systemd)!
}
else {
console.print_debug('startupmanager: auto')
console.print_debug("installer: s3' startupmanager get auto")
return startupmanager.get(.auto)!
}
}
@@ -106,7 +107,7 @@ pub fn (mut self S3Installer) start() ! {
return
}
console.print_header('s3 start')
console.print_header('installer: s3 start')
if !installed()! {
install()!
@@ -119,7 +120,7 @@ pub fn (mut self S3Installer) start() ! {
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
console.print_debug('starting s3 with ${zprocess.startuptype}...')
console.print_debug('installer: s3 starting with ${zprocess.startuptype}...')
sm.new(zprocess)!