vagrant/plugins/provisioners/podman/installer.rb
oss-core-libraries-dashboard[bot] 1a8c7eb042
[COMPLIANCE] Update Copyright and License Headers (Batch 4 of 7) (#13762)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2025-12-22 16:46:54 +05:30

36 lines
1.2 KiB
Ruby

# Copyright IBM Corp. 2010, 2025
# SPDX-License-Identifier: BUSL-1.1
require_relative "../container/installer"
module VagrantPlugins
module PodmanProvisioner
class Installer < VagrantPlugins::ContainerProvisioner::Installer
# This handles verifying the Podman installation, installing it if it was
# requested, and so on. This method will raise exceptions if things are
# wrong.
# @params [Boolean] - if true install should use kubic project (this will)
# add a yum repo.
# if false install comes from default yum
# @return [Boolean] - false if podman cannot be detected on machine, else
# true if podman installs correctly or is installed
def ensure_installed(kubic)
if !@machine.guest.capability?(:podman_installed)
@machine.ui.warn("Podman can not be installed")
return false
end
if !@machine.guest.capability(:podman_installed)
@machine.ui.detail("Podman installing")
@machine.guest.capability(:podman_install, kubic)
end
if !@machine.guest.capability(:podman_installed)
raise PodmanError, :install_failed
end
true
end
end
end
end