diff --git a/lib/installers/db/cometbft/cometbft_factory_.v b/lib/installers/db/cometbft/cometbft_factory_.v index dfe1e122..542d8e0f 100644 --- a/lib/installers/db/cometbft/cometbft_factory_.v +++ b/lib/installers/db/cometbft/cometbft_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&CometBFT { if r.hexists('context:cometbft', args.name)! { data := r.hget('context:cometbft', args.name)! if data.len == 0 { + print_backtrace() return error('CometBFT with name: cometbft does not exist, prob bug.') } mut obj := json.decode(CometBFT, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&CometBFT { if args.create { new(args)! } else { + print_backtrace() return error("CometBFT with name 'cometbft' does not exist") } } return get(name: args.name)! // no longer from db nor create } return cometbft_global[args.name] or { + print_backtrace() return error('could not get config for cometbft with name:cometbft') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'cometbft.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: 'cometbft.')! - 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) ! { cometbft_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: cometbft' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: cometbft' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: cometbft' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: cometbft' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -208,7 +213,7 @@ pub fn (mut self CometBFT) start() ! { return } - console.print_header('cometbft start') + console.print_header('installer: cometbft start') if !installed()! { install()! @@ -221,7 +226,7 @@ pub fn (mut self CometBFT) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting cometbft with ${zprocess.startuptype}...') + console.print_debug('installer: cometbft starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/db/meilisearch_installer/meilisearch_installer_factory_.v b/lib/installers/db/meilisearch_installer/meilisearch_installer_factory_.v index dcdf69c8..bbdd01fc 100644 --- a/lib/installers/db/meilisearch_installer/meilisearch_installer_factory_.v +++ b/lib/installers/db/meilisearch_installer/meilisearch_installer_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&MeilisearchInstaller { if r.hexists('context:meilisearch_installer', args.name)! { data := r.hget('context:meilisearch_installer', args.name)! if data.len == 0 { + print_backtrace() return error('MeilisearchInstaller with name: meilisearch_installer does not exist, prob bug.') } mut obj := json.decode(MeilisearchInstaller, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&MeilisearchInstaller { if args.create { new(args)! } else { + print_backtrace() return error("MeilisearchInstaller with name 'meilisearch_installer' does not exist") } } return get(name: args.name)! // no longer from db nor create } return meilisearch_installer_global[args.name] or { + print_backtrace() return error('could not get config for meilisearch_installer with name:meilisearch_installer') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'meilisearch_installer.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: 'meilisearch_installer.')! - 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) ! { meilisearch_installer_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: meilisearch_installer' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: meilisearch_installer' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: meilisearch_installer' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: meilisearch_installer' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -208,7 +213,7 @@ pub fn (mut self MeilisearchInstaller) start() ! { return } - console.print_header('meilisearch_installer start') + console.print_header('installer: meilisearch_installer start') if !installed()! { install()! @@ -221,7 +226,7 @@ pub fn (mut self MeilisearchInstaller) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting meilisearch_installer with ${zprocess.startuptype}...') + console.print_debug('installer: meilisearch_installer starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/db/postgresql/postgresql_factory_.v b/lib/installers/db/postgresql/postgresql_factory_.v index 5ef509fe..10210aad 100644 --- a/lib/installers/db/postgresql/postgresql_factory_.v +++ b/lib/installers/db/postgresql/postgresql_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&Postgresql { if r.hexists('context:postgresql', args.name)! { data := r.hget('context:postgresql', args.name)! if data.len == 0 { + print_backtrace() return error('Postgresql with name: postgresql does not exist, prob bug.') } mut obj := json.decode(Postgresql, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&Postgresql { if args.create { new(args)! } else { + print_backtrace() return error("Postgresql with name 'postgresql' does not exist") } } return get(name: args.name)! // no longer from db nor create } return postgresql_global[args.name] or { + print_backtrace() return error('could not get config for postgresql with name:postgresql') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'postgresql.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: 'postgresql.')! - 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) ! { postgresql_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: postgresql' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: postgresql' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: postgresql' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: postgresql' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -206,7 +211,7 @@ pub fn (mut self Postgresql) start() ! { return } - console.print_header('postgresql start') + console.print_header('installer: postgresql start') if !installed()! { install()! @@ -219,7 +224,7 @@ pub fn (mut self Postgresql) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting postgresql with ${zprocess.startuptype}...') + console.print_debug('installer: postgresql starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/db/qdrant_installer/qdrant_installer_factory_.v b/lib/installers/db/qdrant_installer/qdrant_installer_factory_.v index d683305d..4cdf077a 100644 --- a/lib/installers/db/qdrant_installer/qdrant_installer_factory_.v +++ b/lib/installers/db/qdrant_installer/qdrant_installer_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&QDrant { if r.hexists('context:qdrant_installer', args.name)! { data := r.hget('context:qdrant_installer', args.name)! if data.len == 0 { + print_backtrace() return error('QDrant with name: qdrant_installer does not exist, prob bug.') } mut obj := json.decode(QDrant, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&QDrant { if args.create { new(args)! } else { + print_backtrace() return error("QDrant with name 'qdrant_installer' does not exist") } } return get(name: args.name)! // no longer from db nor create } return qdrant_installer_global[args.name] or { + print_backtrace() return error('could not get config for qdrant_installer with name:qdrant_installer') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'qdrant_installer.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: 'qdrant_installer.')! - 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) ! { qdrant_installer_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: qdrant_installer' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: qdrant_installer' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: qdrant_installer' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: qdrant_installer' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -208,7 +213,7 @@ pub fn (mut self QDrant) start() ! { return } - console.print_header('qdrant_installer start') + console.print_header('installer: qdrant_installer start') if !installed()! { install()! @@ -221,7 +226,7 @@ pub fn (mut self QDrant) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting qdrant_installer with ${zprocess.startuptype}...') + console.print_debug('installer: qdrant_installer starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/db/zerodb/zerodb_factory_.v b/lib/installers/db/zerodb/zerodb_factory_.v index a6241a5a..796d239c 100644 --- a/lib/installers/db/zerodb/zerodb_factory_.v +++ b/lib/installers/db/zerodb/zerodb_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&ZeroDB { if r.hexists('context:zerodb', args.name)! { data := r.hget('context:zerodb', args.name)! if data.len == 0 { + print_backtrace() return error('ZeroDB with name: zerodb does not exist, prob bug.') } mut obj := json.decode(ZeroDB, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&ZeroDB { if args.create { new(args)! } else { + print_backtrace() return error("ZeroDB with name 'zerodb' does not exist") } } return get(name: args.name)! // no longer from db nor create } return zerodb_global[args.name] or { + print_backtrace() return error('could not get config for zerodb with name:zerodb') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'zerodb.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: 'zerodb.')! - 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) ! { zerodb_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: zerodb' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: zerodb' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: zerodb' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: zerodb' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -206,7 +211,7 @@ pub fn (mut self ZeroDB) start() ! { return } - console.print_header('zerodb start') + console.print_header('installer: zerodb start') if !installed()! { install()! @@ -219,7 +224,7 @@ pub fn (mut self ZeroDB) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting zerodb with ${zprocess.startuptype}...') + console.print_debug('installer: zerodb starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/db/zerofs/zerofs_factory_.v b/lib/installers/db/zerofs/zerofs_factory_.v index 23387891..97c51e17 100644 --- a/lib/installers/db/zerofs/zerofs_factory_.v +++ b/lib/installers/db/zerofs/zerofs_factory_.v @@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure zerofs, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'zerofs.')! - 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) ! { zerofs_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: zerofs' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: zerofs' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: zerofs' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: zerofs' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -106,7 +107,7 @@ pub fn (mut self ZeroFS) start() ! { return } - console.print_header('zerofs start') + console.print_header('installer: zerofs start') if !installed()! { install()! @@ -119,7 +120,7 @@ pub fn (mut self ZeroFS) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting zerofs with ${zprocess.startuptype}...') + console.print_debug('installer: zerofs starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/infra/coredns/coredns_factory_.v b/lib/installers/infra/coredns/coredns_factory_.v index f60a7bf2..08885674 100644 --- a/lib/installers/infra/coredns/coredns_factory_.v +++ b/lib/installers/infra/coredns/coredns_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&CoreDNS { if r.hexists('context:coredns', args.name)! { data := r.hget('context:coredns', args.name)! if data.len == 0 { + print_backtrace() return error('CoreDNS with name: coredns does not exist, prob bug.') } mut obj := json.decode(CoreDNS, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&CoreDNS { if args.create { new(args)! } else { + print_backtrace() return error("CoreDNS with name 'coredns' does not exist") } } return get(name: args.name)! // no longer from db nor create } return coredns_global[args.name] or { + print_backtrace() return error('could not get config for coredns with name:coredns') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'coredns.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: 'coredns.')! - 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) ! { coredns_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: coredns' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: coredns' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: coredns' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: coredns' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -206,7 +211,7 @@ pub fn (mut self CoreDNS) start() ! { return } - console.print_header('coredns start') + console.print_header('installer: coredns start') if !installed()! { install()! @@ -219,7 +224,7 @@ pub fn (mut self CoreDNS) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting coredns with ${zprocess.startuptype}...') + console.print_debug('installer: coredns starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/infra/coredns/play.v b/lib/installers/infra/coredns/play.v deleted file mode 100644 index baf9a9b4..00000000 --- a/lib/installers/infra/coredns/play.v +++ /dev/null @@ -1,23 +0,0 @@ -module coredns - -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.infra.coredns { install } - -pub fn play(mut plbook PlayBook) ! { - if !plbook.exists(filter: 'coredns.') { - return - } - - mut install_action := plbook.ensure_once(filter: 'coredns.install')! - mut p := install_action.params - - mut args := InstallArgs{ - reset: p.get_default_false('reset') - } - - console.print_header('Executing coredns.install action') - install(args)! - - install_action.done = true -} \ No newline at end of file diff --git a/lib/installers/infra/gitea/gitea_factory_.v b/lib/installers/infra/gitea/gitea_factory_.v index 8a0f00ba..459bfc16 100644 --- a/lib/installers/infra/gitea/gitea_factory_.v +++ b/lib/installers/infra/gitea/gitea_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&GiteaServer { if r.hexists('context:gitea', args.name)! { data := r.hget('context:gitea', args.name)! if data.len == 0 { + print_backtrace() return error('GiteaServer with name: gitea does not exist, prob bug.') } mut obj := json.decode(GiteaServer, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&GiteaServer { if args.create { new(args)! } else { + print_backtrace() return error("GiteaServer with name 'gitea' does not exist") } } return get(name: args.name)! // no longer from db nor create } return gitea_global[args.name] or { + print_backtrace() return error('could not get config for gitea with name:gitea') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'gitea.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: 'gitea.')! - 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) ! { gitea_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: gitea' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: gitea' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: gitea' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: gitea' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -206,7 +211,7 @@ pub fn (mut self GiteaServer) start() ! { return } - console.print_header('gitea start') + console.print_header('installer: gitea start') if !installed()! { install()! @@ -219,7 +224,7 @@ pub fn (mut self GiteaServer) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting gitea with ${zprocess.startuptype}...') + console.print_debug('installer: gitea starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/infra/gitea/play.v b/lib/installers/infra/gitea/play.v index 31836f67..9357cf6d 100644 --- a/lib/installers/infra/gitea/play.v +++ b/lib/installers/infra/gitea/play.v @@ -20,4 +20,4 @@ pub fn play(mut plbook PlayBook) ! { install(args)! install_action.done = true -} \ No newline at end of file +} diff --git a/lib/installers/infra/livekit/livekit_actions.v b/lib/installers/infra/livekit/livekit_actions.v index 50aea11a..35f2b64b 100644 --- a/lib/installers/infra/livekit/livekit_actions.v +++ b/lib/installers/infra/livekit/livekit_actions.v @@ -135,19 +135,13 @@ fn install() ! { fn destroy() ! { console.print_header('removing livekit') + osal.process_kill_recursive(name: 'livekit') or { + return error('Could not kill livekit due to: ${err}') + } res := os.execute('sudo rm -rf /usr/local/bin/livekit-server') if res.exit_code != 0 { return error('Failed to remove LiveKit server') } - mut zinit_factory := zinit.new()! - if zinit_factory.exists('livekit') { - zinit_factory.stop('livekit') or { - return error('Could not stop livekit service due to: ${err}') - } - zinit_factory.delete('livekit') or { - return error('Could not delete livekit service due to: ${err}') - } - } console.print_header('livekit removed') } diff --git a/lib/installers/infra/livekit/livekit_factory_.v b/lib/installers/infra/livekit/livekit_factory_.v index fe39f226..9d920286 100644 --- a/lib/installers/infra/livekit/livekit_factory_.v +++ b/lib/installers/infra/livekit/livekit_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&LivekitServer { if r.hexists('context:livekit', args.name)! { data := r.hget('context:livekit', args.name)! if data.len == 0 { + print_backtrace() return error('LivekitServer with name: livekit does not exist, prob bug.') } mut obj := json.decode(LivekitServer, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&LivekitServer { if args.create { new(args)! } else { + print_backtrace() return error("LivekitServer with name 'livekit' does not exist") } } return get(name: args.name)! // no longer from db nor create } return livekit_global[args.name] or { + print_backtrace() return error('could not get config for livekit with name:livekit') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'livekit.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: 'livekit.')! - 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) ! { livekit_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: livekit' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: livekit' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: livekit' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: livekit' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -208,7 +213,7 @@ pub fn (mut self LivekitServer) start() ! { return } - console.print_header('livekit start') + console.print_header('installer: livekit start') if !installed()! { install()! @@ -221,7 +226,7 @@ pub fn (mut self LivekitServer) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting livekit with ${zprocess.startuptype}...') + console.print_debug('installer: livekit starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/infra/livekit/play.v b/lib/installers/infra/livekit/play.v deleted file mode 100644 index 4fff3bb5..00000000 --- a/lib/installers/infra/livekit/play.v +++ /dev/null @@ -1,23 +0,0 @@ -module livekit - -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.infra.livekit { install } - -pub fn play(mut plbook PlayBook) ! { - if !plbook.exists(filter: 'livekit.') { - return - } - - mut install_action := plbook.ensure_once(filter: 'livekit.install')! - mut p := install_action.params - - mut args := InstallArgs{ - reset: p.get_default_false('reset') - } - - console.print_header('Executing livekit.install action') - install(args)! - - install_action.done = true -} \ No newline at end of file diff --git a/lib/installers/infra/zinit_installer/play.v b/lib/installers/infra/zinit_installer/play.v deleted file mode 100644 index 90787b11..00000000 --- a/lib/installers/infra/zinit_installer/play.v +++ /dev/null @@ -1,23 +0,0 @@ -module zinit_installer - -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.infra.zinit_installer { install } - -pub fn play(mut plbook PlayBook) ! { - if !plbook.exists(filter: 'zinit_installer.') { - return - } - - mut install_action := plbook.ensure_once(filter: 'zinit_installer.install')! - mut p := install_action.params - - mut args := InstallArgs{ - reset: p.get_default_false('reset') - } - - console.print_header('Executing zinit_installer.install action') - install(args)! - - install_action.done = true -} \ No newline at end of file diff --git a/lib/installers/infra/zinit_installer/zinit_installer_actions.v b/lib/installers/infra/zinit_installer/zinit_installer_actions.v index bf23c623..9298ce86 100644 --- a/lib/installers/infra/zinit_installer/zinit_installer_actions.v +++ b/lib/installers/infra/zinit_installer/zinit_installer_actions.v @@ -16,7 +16,7 @@ fn startupcmd() ![]startupmanager.ZProcessNewArgs { if core.is_linux()! { res << startupmanager.ZProcessNewArgs{ name: 'zinit' - cmd: '/usr/local/bin/zinit init ${os.home_dir()}/hero/cfg/zinit' + cmd: '/usr/local/bin/zinit init -c ${os.home_dir()}/hero/cfg/zinit' startuptype: .systemd start: true restart: true @@ -24,7 +24,7 @@ fn startupcmd() ![]startupmanager.ZProcessNewArgs { } else { res << startupmanager.ZProcessNewArgs{ name: 'zinit' - cmd: '${os.home_dir()}/hero/bin/zinit init --config ${os.home_dir()}/hero/cfg/zinit' + cmd: '${os.home_dir()}/hero/bin/zinit init -c ${os.home_dir()}/hero/cfg/zinit' startuptype: .screen start: true } diff --git a/lib/installers/infra/zinit_installer/zinit_installer_factory_.v b/lib/installers/infra/zinit_installer/zinit_installer_factory_.v index 5098a968..41a4baaa 100644 --- a/lib/installers/infra/zinit_installer/zinit_installer_factory_.v +++ b/lib/installers/infra/zinit_installer/zinit_installer_factory_.v @@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure zinit_installer, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'zinit_installer.')! - 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) ! { zinit_installer_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: zinit_installer' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: zinit_installer' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: zinit_installer' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: zinit_installer' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -106,7 +107,7 @@ pub fn (mut self ZinitInstaller) start() ! { return } - console.print_header('zinit_installer start') + console.print_header('installer: zinit_installer start') if !installed()! { install()! @@ -119,7 +120,7 @@ pub fn (mut self ZinitInstaller) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting zinit_installer with ${zprocess.startuptype}...') + console.print_debug('installer: zinit_installer starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/lang/golang/golang_factory_.v b/lib/installers/lang/golang/golang_factory_.v index 316daa27..e7cb7ecb 100644 --- a/lib/installers/lang/golang/golang_factory_.v +++ b/lib/installers/lang/golang/golang_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure golang, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'golang.')! - 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 } } diff --git a/lib/installers/lang/nodejs/nodejs_factory_.v b/lib/installers/lang/nodejs/nodejs_factory_.v index 02f69b5d..9eec5145 100644 --- a/lib/installers/lang/nodejs/nodejs_factory_.v +++ b/lib/installers/lang/nodejs/nodejs_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure nodejs, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'nodejs.')! - 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 } } diff --git a/lib/installers/lang/python/python_factory_.v b/lib/installers/lang/python/python_factory_.v index 8a5df925..5fd99051 100644 --- a/lib/installers/lang/python/python_factory_.v +++ b/lib/installers/lang/python/python_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure python, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'python.')! - 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 } } diff --git a/lib/installers/lang/rust/rust_factory_.v b/lib/installers/lang/rust/rust_factory_.v index 09ea1c76..f6553aba 100644 --- a/lib/installers/lang/rust/rust_factory_.v +++ b/lib/installers/lang/rust/rust_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure rust, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'rust.')! - 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 } } diff --git a/lib/installers/net/mycelium_installer/mycelium_installer_factory_.v b/lib/installers/net/mycelium_installer/mycelium_installer_factory_.v index daa9a475..cfe2b0b1 100644 --- a/lib/installers/net/mycelium_installer/mycelium_installer_factory_.v +++ b/lib/installers/net/mycelium_installer/mycelium_installer_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&MyceliumInstaller { if r.hexists('context:mycelium_installer', args.name)! { data := r.hget('context:mycelium_installer', args.name)! if data.len == 0 { + print_backtrace() return error('MyceliumInstaller with name: mycelium_installer does not exist, prob bug.') } mut obj := json.decode(MyceliumInstaller, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&MyceliumInstaller { if args.create { new(args)! } else { + print_backtrace() return error("MyceliumInstaller with name 'mycelium_installer' does not exist") } } return get(name: args.name)! // no longer from db nor create } return mycelium_installer_global[args.name] or { + print_backtrace() return error('could not get config for mycelium_installer with name:mycelium_installer') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'mycelium_installer.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: 'mycelium_installer.')! - 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) ! { mycelium_installer_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: mycelium_installer' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: mycelium_installer' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: mycelium_installer' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: mycelium_installer' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -208,7 +213,7 @@ pub fn (mut self MyceliumInstaller) start() ! { return } - console.print_header('mycelium_installer start') + console.print_header('installer: mycelium_installer start') if !installed()! { install()! @@ -221,7 +226,7 @@ pub fn (mut self MyceliumInstaller) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting mycelium_installer with ${zprocess.startuptype}...') + console.print_debug('installer: mycelium_installer starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/net/wireguard_installer/wireguard_installer_factory_.v b/lib/installers/net/wireguard_installer/wireguard_installer_factory_.v index 90876b5b..f475577f 100644 --- a/lib/installers/net/wireguard_installer/wireguard_installer_factory_.v +++ b/lib/installers/net/wireguard_installer/wireguard_installer_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure wireguard_installer, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'wireguard_installer.')! - 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 } } diff --git a/lib/installers/net/yggdrasil/yggdrasil_factory_.v b/lib/installers/net/yggdrasil/yggdrasil_factory_.v index cc6d989e..2633140c 100644 --- a/lib/installers/net/yggdrasil/yggdrasil_factory_.v +++ b/lib/installers/net/yggdrasil/yggdrasil_factory_.v @@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure yggdrasil, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'yggdrasil.')! - 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) ! { yggdrasil_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: yggdrasil' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: yggdrasil' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: yggdrasil' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: yggdrasil' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -106,7 +107,7 @@ pub fn (mut self YggdrasilInstaller) start() ! { return } - console.print_header('yggdrasil start') + console.print_header('installer: yggdrasil start') if !installed()! { install()! @@ -119,7 +120,7 @@ pub fn (mut self YggdrasilInstaller) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting yggdrasil with ${zprocess.startuptype}...') + console.print_debug('installer: yggdrasil starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/sysadmintools/actrunner/actrunner_factory_.v b/lib/installers/sysadmintools/actrunner/actrunner_factory_.v index e486f471..7fb022d5 100644 --- a/lib/installers/sysadmintools/actrunner/actrunner_factory_.v +++ b/lib/installers/sysadmintools/actrunner/actrunner_factory_.v @@ -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)! diff --git a/lib/installers/sysadmintools/b2/b2_factory_.v b/lib/installers/sysadmintools/b2/b2_factory_.v index 649206a5..821acbe3 100644 --- a/lib/installers/sysadmintools/b2/b2_factory_.v +++ b/lib/installers/sysadmintools/b2/b2_factory_.v @@ -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 } } diff --git a/lib/installers/sysadmintools/fungistor/fungistor_factory_.v b/lib/installers/sysadmintools/fungistor/fungistor_factory_.v index 0784072e..2694f51b 100644 --- a/lib/installers/sysadmintools/fungistor/fungistor_factory_.v +++ b/lib/installers/sysadmintools/fungistor/fungistor_factory_.v @@ -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)! diff --git a/lib/installers/sysadmintools/garage_s3/garage_s3_factory_.v b/lib/installers/sysadmintools/garage_s3/garage_s3_factory_.v index 7aa8843a..c97de7ac 100644 --- a/lib/installers/sysadmintools/garage_s3/garage_s3_factory_.v +++ b/lib/installers/sysadmintools/garage_s3/garage_s3_factory_.v @@ -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)! diff --git a/lib/installers/sysadmintools/grafana/grafana_factory_.v b/lib/installers/sysadmintools/grafana/grafana_factory_.v index 40f6b836..826ced0f 100644 --- a/lib/installers/sysadmintools/grafana/grafana_factory_.v +++ b/lib/installers/sysadmintools/grafana/grafana_factory_.v @@ -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)! diff --git a/lib/installers/sysadmintools/prometheus/prometheus_factory_.v b/lib/installers/sysadmintools/prometheus/prometheus_factory_.v index 2f23dd9d..797a7d05 100644 --- a/lib/installers/sysadmintools/prometheus/prometheus_factory_.v +++ b/lib/installers/sysadmintools/prometheus/prometheus_factory_.v @@ -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)! diff --git a/lib/installers/sysadmintools/rclone/rclone_factory_.v b/lib/installers/sysadmintools/rclone/rclone_factory_.v index 8456adac..08802660 100644 --- a/lib/installers/sysadmintools/rclone/rclone_factory_.v +++ b/lib/installers/sysadmintools/rclone/rclone_factory_.v @@ -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 } } diff --git a/lib/installers/sysadmintools/restic/restic_factory_.v b/lib/installers/sysadmintools/restic/restic_factory_.v index 582c862f..634670cb 100644 --- a/lib/installers/sysadmintools/restic/restic_factory_.v +++ b/lib/installers/sysadmintools/restic/restic_factory_.v @@ -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)! diff --git a/lib/installers/sysadmintools/s3/s3_factory_.v b/lib/installers/sysadmintools/s3/s3_factory_.v index db4936f1..763737c9 100644 --- a/lib/installers/sysadmintools/s3/s3_factory_.v +++ b/lib/installers/sysadmintools/s3/s3_factory_.v @@ -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)! diff --git a/lib/installers/threefold/griddriver/griddriver_factory_.v b/lib/installers/threefold/griddriver/griddriver_factory_.v index 8068cb8f..4f287f41 100644 --- a/lib/installers/threefold/griddriver/griddriver_factory_.v +++ b/lib/installers/threefold/griddriver/griddriver_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure griddriver, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'griddriver.')! - 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 } } diff --git a/lib/installers/virt/cloudhypervisor/cloudhypervisor_factory_.v b/lib/installers/virt/cloudhypervisor/cloudhypervisor_factory_.v index 32def1bc..e196a292 100644 --- a/lib/installers/virt/cloudhypervisor/cloudhypervisor_factory_.v +++ b/lib/installers/virt/cloudhypervisor/cloudhypervisor_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure cloudhypervisor, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'cloudhypervisor.')! - 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 } } diff --git a/lib/installers/virt/docker/docker_factory_.v b/lib/installers/virt/docker/docker_factory_.v index ecbe17c5..92fcf208 100644 --- a/lib/installers/virt/docker/docker_factory_.v +++ b/lib/installers/virt/docker/docker_factory_.v @@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure docker, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'docker.')! - 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) ! { docker_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: docker' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: docker' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: docker' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: docker' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -107,7 +108,7 @@ pub fn (mut self DockerInstaller) start() ! { return } - console.print_header('docker start') + console.print_header('installer: docker start') if !installed()! { install()! @@ -120,7 +121,7 @@ pub fn (mut self DockerInstaller) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting docker with ${zprocess.startuptype}...') + console.print_debug('installer: docker starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/virt/lima/lima_factory_.v b/lib/installers/virt/lima/lima_factory_.v index c8bc7bfa..abc43860 100644 --- a/lib/installers/virt/lima/lima_factory_.v +++ b/lib/installers/virt/lima/lima_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&LimaInstaller { if r.hexists('context:lima', args.name)! { data := r.hget('context:lima', args.name)! if data.len == 0 { + print_backtrace() return error('LimaInstaller with name: lima does not exist, prob bug.') } mut obj := json.decode(LimaInstaller, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&LimaInstaller { if args.create { new(args)! } else { + print_backtrace() return error("LimaInstaller with name 'lima' does not exist") } } return get(name: args.name)! // no longer from db nor create } return lima_global[args.name] or { + print_backtrace() return error('could not get config for lima with name:lima') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'lima.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: 'lima.')! - 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) ! { lima_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: lima' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: lima' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: lima' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: lima' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -206,7 +211,7 @@ pub fn (mut self LimaInstaller) start() ! { return } - console.print_header('lima start') + console.print_header('installer: lima start') if !installed()! { install()! @@ -219,7 +224,7 @@ pub fn (mut self LimaInstaller) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting lima with ${zprocess.startuptype}...') + console.print_debug('installer: lima starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/virt/pacman/pacman_factory_.v b/lib/installers/virt/pacman/pacman_factory_.v index 30e6c47e..720ac080 100644 --- a/lib/installers/virt/pacman/pacman_factory_.v +++ b/lib/installers/virt/pacman/pacman_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure pacman, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'pacman.')! - 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 } } diff --git a/lib/installers/virt/podman/podman_factory_.v b/lib/installers/virt/podman/podman_factory_.v index 1349142e..e1c23198 100644 --- a/lib/installers/virt/podman/podman_factory_.v +++ b/lib/installers/virt/podman/podman_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure podman, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'podman.')! - 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 } } diff --git a/lib/installers/virt/youki/youki_factory_.v b/lib/installers/virt/youki/youki_factory_.v index bed16b94..6998bafa 100644 --- a/lib/installers/virt/youki/youki_factory_.v +++ b/lib/installers/virt/youki/youki_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure youki, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'youki.')! - 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 } } diff --git a/lib/installers/web/bun/bun_factory_.v b/lib/installers/web/bun/bun_factory_.v index 6c47d073..00f04ff6 100644 --- a/lib/installers/web/bun/bun_factory_.v +++ b/lib/installers/web/bun/bun_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure bun, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'bun.')! - 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 } } diff --git a/lib/installers/web/imagemagick/imagemagick_factory_.v b/lib/installers/web/imagemagick/imagemagick_factory_.v index fcaa2f7d..65fad358 100644 --- a/lib/installers/web/imagemagick/imagemagick_factory_.v +++ b/lib/installers/web/imagemagick/imagemagick_factory_.v @@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure imagemagick, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'imagemagick.')! - 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) ! { imagemagick_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: imagemagick' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: imagemagick' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: imagemagick' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: imagemagick' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -106,7 +107,7 @@ pub fn (mut self ImageMagick) start() ! { return } - console.print_header('imagemagick start') + console.print_header('installer: imagemagick start') if !installed()! { install()! @@ -119,7 +120,7 @@ pub fn (mut self ImageMagick) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting imagemagick with ${zprocess.startuptype}...') + console.print_debug('installer: imagemagick starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/web/lighttpd/lighttpd_factory_.v b/lib/installers/web/lighttpd/lighttpd_factory_.v index ee7f1802..7c506f90 100644 --- a/lib/installers/web/lighttpd/lighttpd_factory_.v +++ b/lib/installers/web/lighttpd/lighttpd_factory_.v @@ -36,7 +36,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure lighttpd, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'lighttpd.')! - 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) ! { lighttpd_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: lighttpd' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: lighttpd' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: lighttpd' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: lighttpd' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -106,7 +107,7 @@ pub fn (mut self LightHttpdInstaller) start() ! { return } - console.print_header('lighttpd start') + console.print_header('installer: lighttpd start') if !installed()! { install()! @@ -119,7 +120,7 @@ pub fn (mut self LightHttpdInstaller) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting lighttpd with ${zprocess.startuptype}...') + console.print_debug('installer: lighttpd starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/web/tailwind/tailwind_factory_.v b/lib/installers/web/tailwind/tailwind_factory_.v index b08d4ce2..63ec9d5a 100644 --- a/lib/installers/web/tailwind/tailwind_factory_.v +++ b/lib/installers/web/tailwind/tailwind_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure tailwind, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'tailwind.')! - 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 } } diff --git a/lib/installers/web/tailwind4/tailwind4_factory_.v b/lib/installers/web/tailwind4/tailwind4_factory_.v index 3ca1b96d..bb6b3c5b 100644 --- a/lib/installers/web/tailwind4/tailwind4_factory_.v +++ b/lib/installers/web/tailwind4/tailwind4_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure tailwind4, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'tailwind4.')! - 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 } } diff --git a/lib/installers/web/traefik/traefik_factory_.v b/lib/installers/web/traefik/traefik_factory_.v index bc9d0512..1162e29a 100644 --- a/lib/installers/web/traefik/traefik_factory_.v +++ b/lib/installers/web/traefik/traefik_factory_.v @@ -38,6 +38,7 @@ pub fn get(args ArgsGet) !&TraefikServer { if r.hexists('context:traefik', args.name)! { data := r.hget('context:traefik', args.name)! if data.len == 0 { + print_backtrace() return error('TraefikServer with name: traefik does not exist, prob bug.') } mut obj := json.decode(TraefikServer, data)! @@ -46,12 +47,14 @@ pub fn get(args ArgsGet) !&TraefikServer { if args.create { new(args)! } else { + print_backtrace() return error("TraefikServer with name 'traefik' does not exist") } } return get(name: args.name)! // no longer from db nor create } return traefik_global[args.name] or { + print_backtrace() return error('could not get config for traefik with name:traefik') } } @@ -124,14 +127,15 @@ pub fn play(mut plbook PlayBook) ! { } mut install_actions := plbook.find(filter: 'traefik.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: 'traefik.')! - 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) ! { traefik_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: traefik' startupmanager get screen") return startupmanager.get(.screen)! } .zinit { - console.print_debug('startupmanager: zinit') + console.print_debug("installer: traefik' startupmanager get zinit") return startupmanager.get(.zinit)! } .systemd { - console.print_debug('startupmanager: systemd') + console.print_debug("installer: traefik' startupmanager get systemd") return startupmanager.get(.systemd)! } else { - console.print_debug('startupmanager: auto') + console.print_debug("installer: traefik' startupmanager get auto") return startupmanager.get(.auto)! } } @@ -206,7 +211,7 @@ pub fn (mut self TraefikServer) start() ! { return } - console.print_header('traefik start') + console.print_header('installer: traefik start') if !installed()! { install()! @@ -219,7 +224,7 @@ pub fn (mut self TraefikServer) start() ! { for zprocess in startupcmd()! { mut sm := startupmanager_get(zprocess.startuptype)! - console.print_debug('starting traefik with ${zprocess.startuptype}...') + console.print_debug('installer: traefik starting with ${zprocess.startuptype}...') sm.new(zprocess)! diff --git a/lib/installers/web/zola/zola_factory_.v b/lib/installers/web/zola/zola_factory_.v index 6203cd38..089fd776 100644 --- a/lib/installers/web/zola/zola_factory_.v +++ b/lib/installers/web/zola/zola_factory_.v @@ -35,7 +35,7 @@ pub fn play(mut plbook PlayBook) ! { return error("can't configure zola, because no configuration allowed for this installer.") } mut other_actions := plbook.find(filter: 'zola.')! - 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 } }