Skip to content

Commit

Permalink
Add the needed packages before installing the software
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Aug 23, 2023
1 parent 2b28ba2 commit 527b531
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions service/lib/agama/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def install_phase
software.propose
end

ProxySetup.instance.propose

progress.step("Installing Software") { software.install }

on_target do
Expand Down
23 changes: 19 additions & 4 deletions service/lib/agama/proxy_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,25 @@ def initialize
Yast.import "Proxy"
Yast.import "Installation"
Yast.import "PackagesProposal"

Proxy.Read
end

def run
read
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

Expand Down Expand Up @@ -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

0 comments on commit 527b531

Please sign in to comment.