From 527b5310718845ac1896b788adf22fd670c01403 Mon Sep 17 00:00:00 2001 From: Knut Anderssen Date: Wed, 23 Aug 2023 11:36:48 +0100 Subject: [PATCH] Add the needed packages before installing the software --- service/lib/agama/manager.rb | 2 ++ service/lib/agama/proxy_setup.rb | 23 +++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/service/lib/agama/manager.rb b/service/lib/agama/manager.rb index ba54bb54c7..c6bb561e1b 100644 --- a/service/lib/agama/manager.rb +++ b/service/lib/agama/manager.rb @@ -98,6 +98,8 @@ def install_phase software.propose end + ProxySetup.instance.propose + progress.step("Installing Software") { software.install } on_target do diff --git a/service/lib/agama/proxy_setup.rb b/service/lib/agama/proxy_setup.rb index cdc32a252d..46704f47b1 100644 --- a/service/lib/agama/proxy_setup.rb +++ b/service/lib/agama/proxy_setup.rb @@ -48,6 +48,8 @@ def initialize Yast.import "Proxy" Yast.import "Installation" Yast.import "PackagesProposal" + + Proxy.Read end def run @@ -55,13 +57,16 @@ def run write end + def propose + on_target { add_packages } if Proxy.enabled + end + def install - on_local do - Proxy.Read - return unless Proxy.enabled + return unless Proxy.enabled + on_local do copy_files - add_packages + enable_services end end @@ -133,5 +138,15 @@ def copy_files log.info "Copying proxy configuration to the target system" ::FileUtils.cp(CONFIG_PATH, File.join(Yast::Installation.destdir, CONFIG_PATH)) end + + def enable_services + service = Yast2::Systemd::Service.find("setup-systemd-proxy-env") + if service.nil? + logger.error "setup-systemd-proxy-env service was not found" + return + end + + Yast::Execute.on_target!("systemctl", "enable", "setup-systemd-proxy-env.path") + end end end